diff --git a/mozilla/modules/plugin/base/src/ns4xPlugin.cpp b/mozilla/modules/plugin/base/src/ns4xPlugin.cpp index 9d34d886aa3..fb403cb9e70 100644 --- a/mozilla/modules/plugin/base/src/ns4xPlugin.cpp +++ b/mozilla/modules/plugin/base/src/ns4xPlugin.cpp @@ -243,7 +243,6 @@ static void* FP2TV(void *fp) //////////////////////////////////////////////////////////////////////// // Globals NPNetscapeFuncs ns4xPlugin::CALLBACKS; -static nsIMemory* gMalloc = nsnull; //////////////////////////////////////////////////////////////////////// void @@ -522,13 +521,6 @@ ns4xPlugin::~ns4xPlugin(void) } -//////////////////////////////////////////////////////////////////////// -void ns4xPlugin::ReleaseStatics() -{ - NS_IF_RELEASE(gMalloc); -} - - #if defined(XP_MAC) || defined(XP_MACOSX) //////////////////////////////////////////////////////////////////////// void ns4xPlugin::SetPluginRefNum(short aRefNum) @@ -555,12 +547,6 @@ ns4xPlugin::CreatePlugin(nsIServiceManagerObsolete* aServiceMgr, { CheckClassInitialized(); - // set up the MemAllocator service now because it might be used by the plugin - if (aServiceMgr && !gMalloc) { - aServiceMgr->GetService(kMemoryCID, NS_GET_IID(nsIMemory), - (nsISupports**)&gMalloc); - } - #if defined(XP_UNIX) && !defined(XP_MACOSX) ns4xPlugin *plptr; @@ -1183,7 +1169,7 @@ _memfree (void *ptr) NPN_PLUGIN_LOG(PLUGIN_LOG_NOISY, ("NPN_MemFree: ptr=%p\n", ptr)); if(ptr) - gMalloc->Free(ptr); + nsMemory::Free(ptr); } @@ -1193,7 +1179,7 @@ _memflush(uint32 size) { NPN_PLUGIN_LOG(PLUGIN_LOG_NOISY, ("NPN_MemFlush: size=%d\n", size)); - gMalloc->HeapMinimize(PR_TRUE); + nsMemory::HeapMinimize(PR_TRUE); return 0; } @@ -2062,7 +2048,7 @@ void * NP_EXPORT _memalloc (uint32 size) { NPN_PLUGIN_LOG(PLUGIN_LOG_NOISY, ("NPN_MemAlloc: size=%d\n", size)); - return gMalloc->Alloc(size); + return nsMemory::Alloc(size); } #ifdef OJI diff --git a/mozilla/modules/plugin/base/src/ns4xPlugin.h b/mozilla/modules/plugin/base/src/ns4xPlugin.h index 2468b77ea52..aebfbfaa9ae 100644 --- a/mozilla/modules/plugin/base/src/ns4xPlugin.h +++ b/mozilla/modules/plugin/base/src/ns4xPlugin.h @@ -101,8 +101,6 @@ public: nsIServiceManagerObsolete* serviceMgr); virtual ~ns4xPlugin(void); - static void ReleaseStatics(); - NS_DECL_ISUPPORTS //nsIFactory interface diff --git a/mozilla/modules/plugin/base/src/nsPluginModule.cpp b/mozilla/modules/plugin/base/src/nsPluginModule.cpp index 4be1111bebb..8b496b22ff8 100644 --- a/mozilla/modules/plugin/base/src/nsPluginModule.cpp +++ b/mozilla/modules/plugin/base/src/nsPluginModule.cpp @@ -54,11 +54,4 @@ static const nsModuleComponentInfo gComponentInfo[] = { nsPluginHostImpl::Create }, }; -PR_STATIC_CALLBACK(void) -nsPluginModuleDtor(nsIModule *self) -{ - ns4xPlugin::ReleaseStatics(); -} - -NS_IMPL_NSGETMODULE_WITH_DTOR(nsPluginModule, gComponentInfo, - nsPluginModuleDtor) +NS_IMPL_NSGETMODULE(nsPluginModule, gComponentInfo)