diff --git a/netwerk/base/src/nsSocketTransportService2.cpp b/netwerk/base/src/nsSocketTransportService2.cpp index c36bebd069c8..a27d2fa50afb 100644 --- a/netwerk/base/src/nsSocketTransportService2.cpp +++ b/netwerk/base/src/nsSocketTransportService2.cpp @@ -365,6 +365,9 @@ nsSocketTransportService::Init() if (mInitialized) return NS_OK; + if (mShuttingDown) + return NS_ERROR_UNEXPECTED; + if (!mThreadEvent) { mThreadEvent = PR_NewPollableEvent(); // @@ -401,6 +404,9 @@ nsSocketTransportService::Shutdown() if (!mInitialized) return NS_OK; + if (mShuttingDown) + return NS_ERROR_UNEXPECTED; + { nsAutoLock lock(mLock);