Bug 684492 - shutdown crash nsLDAPConnection::~nsLDAPConnection(). r=standard8 a=standard8
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Thu, 20 Oct 2011 16:12:31 +0900
changeset 9301 fa28ff6e1695998da63cdf49640d5124254c36db
parent 9300 603a1f04140b6d38e162deebcc6a6df13b3be5d1
child 9302 9ba50533feff718d19a5222a273d45571f4aeb37
push id230
push userbugzilla@standard8.plus.com
push dateTue, 08 Nov 2011 22:55:24 +0000
treeherdercomm-beta@63dad5648415 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersstandard8, standard8
bugs684492
Bug 684492 - shutdown crash nsLDAPConnection::~nsLDAPConnection(). r=standard8 a=standard8
ldap/xpcom/src/nsLDAPConnection.cpp
--- a/ldap/xpcom/src/nsLDAPConnection.cpp
+++ b/ldap/xpcom/src/nsLDAPConnection.cpp
@@ -78,17 +78,18 @@ nsLDAPConnection::nsLDAPConnection()
 }
 
 // destructor
 //
 nsLDAPConnection::~nsLDAPConnection()
 {
   nsCOMPtr<nsIObserverService> obsServ =
       mozilla::services::GetObserverService();
-  obsServ->RemoveObserver(this, "profile-change-net-teardown");
+  if (obsServ)
+      obsServ->RemoveObserver(this, "profile-change-net-teardown");
   Close();
 }
 
 NS_IMPL_THREADSAFE_ADDREF(nsLDAPConnection)
 NS_IMPL_THREADSAFE_RELEASE(nsLDAPConnection)
 NS_IMPL_CLASSINFO(nsLDAPConnection, NULL, nsIClassInfo::THREADSAFE,
                   NS_LDAPCONNECTION_CID)