CloseCachedConnections(); if (m_prefs) nsServiceManager::ReleaseService(kPrefServiceCID, m_prefs); UnloadAccounts(); NS_IF_RELEASE(m_accounts);
nsresult rv;  if(!m_haveShutdown) { Shutdown();   nsCOMPtr<nsIObserverService> observerService = do_GetService("@mozilla.org/observer-service;1", &rv); if (NS_SUCCEEDED(rv)) { observerService->RemoveObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID); observerService->RemoveObserver(this, ABOUT_TO_GO_OFFLINE_TOPIC); } }
nsMsgAccountManager::~nsMsgAccountManager(){  CloseCachedConnections();  if (m_prefs) nsServiceManager::ReleaseService(kPrefServiceCID, m_prefs);  UnloadAccounts();  NS_IF_RELEASE(m_accounts);}