Bug 1164543 - Remove gAllInstances from PluginModuleChild (r=jimm)

This commit is contained in:
Bill McCloskey
2015-06-17 15:28:39 -07:00
parent 0e72bb1aba
commit e52d70b575

View File

@@ -67,7 +67,6 @@ const wchar_t * kMozillaWindowClass = L"MozillaWindowClass";
namespace {
// see PluginModuleChild::GetChrome()
PluginModuleChild* gChromeInstance = nullptr;
nsTArray<PluginModuleChild*>* gAllInstances;
}
#ifdef MOZ_WIDGET_QT
@@ -142,11 +141,6 @@ PluginModuleChild::PluginModuleChild(bool aIsChrome)
, mGlobalCallWndProcHook(nullptr)
#endif
{
if (!gAllInstances) {
gAllInstances = new nsTArray<PluginModuleChild*>(1);
}
gAllInstances->AppendElement(this);
memset(&mFunctions, 0, sizeof(mFunctions));
if (mIsChrome) {
MOZ_ASSERT(!gChromeInstance);
@@ -170,13 +164,6 @@ PluginModuleChild::~PluginModuleChild()
XRE_GetIOMessageLoop()->PostTask(FROM_HERE, new DeleteTask<Transport>(mTransport));
}
gAllInstances->RemoveElement(this);
MOZ_ASSERT_IF(mIsChrome, gAllInstances->Length() == 0);
if (gAllInstances->IsEmpty()) {
delete gAllInstances;
gAllInstances = nullptr;
}
if (mIsChrome) {
MOZ_ASSERT(gChromeInstance == this);