Bug 951511. If jar module shutdown happens before all the jar channels are destroyed, we still shouldn't crash. r=bsmedberg

This commit is contained in:
Boris Zbarsky 2013-12-18 11:20:45 -05:00
parent e223f9691c
commit 09c5605923
2 changed files with 6 additions and 1 deletions

View File

@ -45,7 +45,10 @@ static const mozilla::Module::ContractIDEntry kJARContracts[] = {
// Jar module shutdown hook
static void nsJarShutdown()
{
NS_IF_RELEASE(gJarHandler);
// Make sure to not null out gJarHandler here, because we may have
// still-live nsJARChannels that will want to release it.
nsJARProtocolHandler *handler = gJarHandler;
NS_IF_RELEASE(handler);
}
static const mozilla::Module kJARModule = {

View File

@ -39,6 +39,8 @@ nsJARProtocolHandler::nsJARProtocolHandler()
nsJARProtocolHandler::~nsJARProtocolHandler()
{
MOZ_ASSERT(gJarHandler == this);
gJarHandler = nullptr;
}
nsresult