From 6a2e29868d498a601fd19f3f15444c4d77553f72 Mon Sep 17 00:00:00 2001 From: "gagan%netscape.com" Date: Sat, 15 Jul 2000 01:47:30 +0000 Subject: [PATCH] Complete fix for bug 41433 (assert/crash in DNS for offline-online) We were not destroying the monitor in shutdown. r=bryner. git-svn-id: svn://10.0.0.236/trunk@74285 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/netwerk/dns/src/nsDnsService.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mozilla/netwerk/dns/src/nsDnsService.cpp b/mozilla/netwerk/dns/src/nsDnsService.cpp index 1a0bb6cd796..89a20efc290 100644 --- a/mozilla/netwerk/dns/src/nsDnsService.cpp +++ b/mozilla/netwerk/dns/src/nsDnsService.cpp @@ -1202,6 +1202,9 @@ nsDNSService::Shutdown() if (mThread == nsnull) return rv; #endif + if (!mMonitor) // already shutdown or not init'ed as yet. + return rv; + { nsAutoMonitor mon(mMonitor); // protect mLookups @@ -1236,6 +1239,12 @@ nsDNSService::Shutdown() // Have to break the cycle here, otherwise nsDNSService holds onto the thread // and the thread holds onto the nsDNSService via its mRunnable mThread = nsnull; + + if (mMonitor) + { + nsAutoMonitor::DestroyMonitor(mMonitor); + mMonitor = nsnull; + } return rv; }