PL_DestroyEvent(tmp);
FrameManager::DequeuePostedEventFor(nsIFrame* aFrame){  // If there's a posted event for this frame, then remove it  CantRenderReplacedElementEvent** event = FindPostedEventFor(aFrame);  if (*event) {    CantRenderReplacedElementEvent* tmp = *event;    // Remove it from our linked list of posted events    *event = (*event)->mNext;        // Dequeue it from the event queue    nsIEventQueueService* eventService;    nsresult              rv;    rv = nsServiceManager::GetService(kEventQueueServiceCID,                                      NS_GET_IID(nsIEventQueueService),                                      (nsISupports **)&eventService);    NS_ASSERTION(NS_SUCCEEDED(rv),            "will crash soon due to event holding dangling pointer to frame");    if (NS_SUCCEEDED(rv)) {      nsCOMPtr<nsIEventQueue> eventQueue;      rv = eventService->GetThreadEventQueue(NS_CURRENT_THREAD,                                              getter_AddRefs(eventQueue));      nsServiceManager::ReleaseService(kEventQueueServiceCID, eventService);      NS_ASSERTION(NS_SUCCEEDED(rv) && eventQueue,            "will crash soon due to event holding dangling pointer to frame");      if (NS_SUCCEEDED(rv) && eventQueue) {        PLEventQueue* plqueue;        eventQueue->GetPLEventQueue(&plqueue);        NS_ASSERTION(plqueue,            "will crash soon due to event holding dangling pointer to frame");        if (plqueue) {          // Removes the event and destroys it          PL_DequeueEvent(tmp, plqueue);        }      }    }  }}