Bug 669151 - LDAP connections are not cleaned up until shutdown; r=bienvenu

This commit is contained in:
Mark Banner 2011-07-05 15:58:07 +01:00
Родитель 16b7063518
Коммит 2f74b12704
1 изменённых файлов: 9 добавлений и 4 удалений

Просмотреть файл

@ -76,16 +76,15 @@ nsLDAPConnection::nsLDAPConnection()
mVersion(nsILDAPConnection::VERSION3),
mDNSRequest(0)
{
// We have to abort all LDAP pending operation before shutdown.
nsCOMPtr<nsIObserverService> obsServ =
mozilla::services::GetObserverService();
obsServ->AddObserver(this, "profile-change-net-teardown", PR_FALSE);
}
// destructor
//
nsLDAPConnection::~nsLDAPConnection()
{
nsCOMPtr<nsIObserverService> obsServ =
mozilla::services::GetObserverService();
obsServ->RemoveObserver(this, "profile-change-net-teardown");
Close();
}
@ -114,6 +113,12 @@ nsLDAPConnection::Init(nsILDAPURL *aUrl, const nsACString &aBindName,
NS_ENSURE_ARG_POINTER(aUrl);
NS_ENSURE_ARG_POINTER(aMessageListener);
nsCOMPtr<nsIObserverService> obsServ =
mozilla::services::GetObserverService();
// We have to abort all LDAP pending operation before shutdown.
obsServ->AddObserver(this, "profile-change-net-teardown", PR_TRUE);
// Save various items that we'll use later
mBindName.Assign(aBindName);
mClosure = aClosure;