Change extension unload order to avoid exposing finalisation window (bug 5556, r=asherkin).

This commit is contained in:
Kyle Sanderson 2013-02-28 22:04:28 +00:00
parent 5d942265f9
commit c2f7d600aa

View File

@ -805,6 +805,13 @@ bool CExtensionManager::UnloadExtension(IExtension *_pExt)
return false;
}
/* Tell it to unload */
if (pExt->IsLoaded())
{
IExtensionInterface *pAPI = pExt->GetAPI();
pAPI->OnExtensionUnload();
}
/* First remove us from internal lists */
g_ShareSys.RemoveInterfaces(_pExt);
m_Libs.remove(pExt);
@ -899,13 +906,6 @@ bool CExtensionManager::UnloadExtension(IExtension *_pExt)
}
}
/* Tell it to unload */
if (pExt->IsLoaded())
{
IExtensionInterface *pAPI = pExt->GetAPI();
pAPI->OnExtensionUnload();
}
pExt->Unload();
delete pExt;