NS_IF_RELEASE(mCurrentEventContent);
PresShell::Destroy(){#ifdef MOZ_REFLOW_PERF  DumpReflows();  if (mReflowCountMgr) {    delete mReflowCountMgr;    mReflowCountMgr = nsnull;  }#endif  // If our paint suppression timer is still active, kill it.  if (mPaintSuppressionTimer) {    mPaintSuppressionTimer->Cancel();    mPaintSuppressionTimer = nsnull;  }  // release our pref style sheet, if we have one still  ClearPreferenceStyleRules();  // free our table of anonymous content  ReleaseAnonymousContent();  mIsDestroying = PR_TRUE;  // Clobber weak leaks in case of re-entrancy during tear down  mHistoryState = nsnull;  // release current event content and any content on event stack  NS_IF_RELEASE(mCurrentEventContent);  PRInt32 i, count = mCurrentEventContentStack.Count();  nsIContent* currentEventContent;  for (i = 0; i < count; i++) {    currentEventContent = (nsIContent*)mCurrentEventContentStack.ElementAt(i);    NS_IF_RELEASE(currentEventContent);  }  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;  }  // 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  if (mFrameManager) {    mFrameManager->Destroy();    NS_RELEASE(mFrameManager);  }  // Let the style set do its cleanup.  mStyleSet->Shutdown();  mStyleSet = nsnull;  // 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  if (mPendingReflowEvent) {    mPendingReflowEvent = PR_FALSE;    mEventQueue->RevokeEvents(this);  }  CancelAllReflowCommands();  KillResizeEventTimer();  return NS_OK;}