for (PRInt32 i=0;i<mPrintProgressListeners.Count();i++) { nsIWebProgressListener* wpl = NS_STATIC_CAST(nsIWebProgressListener*, mPrintProgressListeners.ElementAt(i)); NS_ASSERTION(wpl, "nsIWebProgressListener is NULL!"); NS_RELEASE(wpl); }
PrintData::~PrintData() {  // printing is complete, clean up now  OnEndPrinting(NS_OK); // removes listener  if (mPrintDC) {#ifdef DEBUG_PRINTING    fprintf(mDebugFD, "****************** End Document ************************\n");#endif    mPrintDC->EndDocument();  }  delete mPrintObject;  mPrintDocList->Clear();  delete mPrintDocList;#ifdef DEBUG_PRINTING  fclose(mDebugFD);#endif  DocumentViewerImpl::mIsDoingPrinting = PR_FALSE;}