if (mReflowCommandTable.ops) { PL_DHashTableFinish(&mReflowCommandTable); }
PresShell::Destroy(){#ifdef MOZ_REFLOW_PERF  DumpReflows();  if (mReflowCountMgr) {    delete mReflowCountMgr;    mReflowCountMgr = nsnull;  }#endif  if (mHaveShutDown)    return NS_OK;  if (mReflowCommandTable.ops) {    PL_DHashTableFinish(&mReflowCommandTable);  }    // If our paint suppression timer is still active, kill it.  if (mPaintSuppressionTimer) {    mPaintSuppressionTimer->Cancel();    mPaintSuppressionTimer = nsnull;  }  if (mCaret) {    mCaret->Terminate();    mCaret = nsnull;  }    // release our pref style sheet, if we have one still  ClearPreferenceStyleRules();  // free our table of anonymous content  ReleaseAnonymousContent();  mIsDestroying = PR_TRUE;  // We can't release all the event content in  // mCurrentEventContentStack here since there might be code on the  // stack that will release the event content too. Double release  // bad!  // The frames will be torn down, so remove them from the current  // event frame stack (since they'd be dangling references if we'd  // leave them in) and null out the mCurrentEventFrame pointer as  // well.  mCurrentEventFrame = nsnull;  PRInt32 i, count = mCurrentEventFrameStack.Count();  for (i = 0; i < count; i++) {    mCurrentEventFrameStack.ReplaceElementAt(nsnull, i);  }  if (mViewManager) {    // Disable paints during tear down of the frame tree    mViewManager->DisableRefresh();    // Clear the view manager's weak pointer back to |this| in case it    // was leaked.    mViewManager->SetViewObserver(nsnull);    mViewManager = nsnull;  }  mStyleSet->BeginShutdown(mPresContext);  // This shell must be removed from the document before the frame  // hierarchy is torn down to avoid finding deleted frames through  // this presshell while the frames are being torn down  if (mDocument) {    mDocument->DeleteShell(this);  }  // Destroy the frame manager. This will destroy the frame hierarchy  mFrameConstructor->WillDestroyFrameTree();  FrameManager()->Destroy();  // Let the style set do its cleanup.  mStyleSet->Shutdown(mPresContext);  // We hold a reference to the pres context, and it holds a weak link back  // to us. To avoid the pres context having a dangling reference, set its   // pres shell to NULL  if (mPresContext) {    mPresContext->SetShell(nsnull);  }  if (mViewEventListener) {    mViewEventListener->SetPresShell((nsIPresShell*)nsnull);    NS_RELEASE(mViewEventListener);  }  // Revoke pending reflow events  mReflowEventQueue = nsnull;  nsCOMPtr<nsIEventQueue> eventQueue;  mEventQueueService->GetSpecialEventQueue(nsIEventQueueService::UI_THREAD_EVENT_QUEUE,                                           getter_AddRefs(eventQueue));  eventQueue->RevokeEvents(this);  CancelAllReflowCommands();  KillResizeEventTimer();  mHaveShutDown = PR_TRUE;  return NS_OK;}