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; }