nsAutoString topic; topic.AssignWithConversion(NS_XPCOM_SHUTDOWN_OBSERVER_ID); observerService->RemoveObserver(this, topic.get());
observerService->RemoveObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID);
nsMsgBiffManager::~nsMsgBiffManager(){  nsresult rv;    if (mBiffTimer) {    mBiffTimer->Cancel();  }    PRInt32 count = mBiffArray->Count();  PRInt32 i;  for(i=0; i < count; i++)  {    nsBiffEntry *biffEntry = (nsBiffEntry*)mBiffArray->ElementAt(i);    delete biffEntry;  }  delete mBiffArray;    if(!mHaveShutdown)  {    Shutdown();    //Don't remove from Observer service in Shutdown because Shutdown also gets called    //from xpcom shutdown observer.  And we don't want to remove from the service in that case.    nsCOMPtr<nsIObserverService> observerService =       do_GetService(NS_OBSERVERSERVICE_CONTRACTID, &rv);    if (NS_SUCCEEDED(rv))    {          nsAutoString topic; topic.AssignWithConversion(NS_XPCOM_SHUTDOWN_OBSERVER_ID);      observerService->RemoveObserver(this, topic.get());    }  }}