if (mClosingWhilePrinting) {
if (mDeferredWindowClose) { mDeferredWindowClose = PR_FALSE; nsCOMPtr<nsIDOMWindowInternal> win = do_GetInterface(mContainer); if (win) win->Close(); } else if (mClosingWhilePrinting) {
DocumentViewerImpl::OnDonePrinting() {#if defined(NS_PRINTING) && defined(NS_PRINT_PREVIEW)  if (mPrintEngine) {    if (GetIsPrintPreview()) {      mPrintEngine->DestroyPrintingData();    } else {      mPrintEngine->Destroy();      NS_RELEASE(mPrintEngine);    }    // We are done printing, now cleanup     if (mClosingWhilePrinting) {      if (mDocument) {        mDocument->SetScriptGlobalObject(nsnull);        mDocument = nsnull;      }      mClosingWhilePrinting = PR_FALSE;      NS_RELEASE_THIS();    }  }#endif // NS_PRINTING && NS_PRINT_PREVIEW}