mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
Bug 948201 - Use a StaticRefPtr for gInterfaceInfoManager. r=bz.
--HG-- extra : rebase_source : be06bb4b77914dd1a5ae2a7e1cced40fcd5850f5
This commit is contained in:
parent
ab71d982d1
commit
fb7fd6fff4
@ -10,6 +10,7 @@
|
||||
|
||||
#include "mozilla/FileUtils.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
|
||||
#include "xptiprivate.h"
|
||||
#include "nsDependentString.h"
|
||||
@ -26,10 +27,7 @@ NS_IMPL_ISUPPORTS_INHERITED1(
|
||||
MemoryUniReporter,
|
||||
nsIInterfaceInfoManager)
|
||||
|
||||
static XPTInterfaceInfoManager* gInterfaceInfoManager = nullptr;
|
||||
#ifdef DEBUG
|
||||
static int gCallCount = 0;
|
||||
#endif
|
||||
static StaticRefPtr<XPTInterfaceInfoManager> gInterfaceInfoManager;
|
||||
|
||||
size_t
|
||||
XPTInterfaceInfoManager::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
||||
@ -62,7 +60,6 @@ XPTInterfaceInfoManager::GetSingleton()
|
||||
{
|
||||
if (!gInterfaceInfoManager) {
|
||||
gInterfaceInfoManager = new XPTInterfaceInfoManager();
|
||||
NS_ADDREF(gInterfaceInfoManager);
|
||||
gInterfaceInfoManager->InitMemoryReporter();
|
||||
}
|
||||
return gInterfaceInfoManager;
|
||||
@ -71,7 +68,7 @@ XPTInterfaceInfoManager::GetSingleton()
|
||||
void
|
||||
XPTInterfaceInfoManager::FreeInterfaceInfoManager()
|
||||
{
|
||||
NS_IF_RELEASE(gInterfaceInfoManager);
|
||||
gInterfaceInfoManager = nullptr;
|
||||
}
|
||||
|
||||
XPTInterfaceInfoManager::XPTInterfaceInfoManager()
|
||||
@ -88,11 +85,6 @@ XPTInterfaceInfoManager::~XPTInterfaceInfoManager()
|
||||
mWorkingSet.InvalidateInterfaceInfos();
|
||||
|
||||
UnregisterWeakMemoryReporter(this);
|
||||
|
||||
gInterfaceInfoManager = nullptr;
|
||||
#ifdef DEBUG
|
||||
gCallCount = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user