зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1050003
- Remove unnecessary if checks before delete-ing in xpcom/. r=froydnj
This commit is contained in:
Родитель
3e8abfd2e8
Коммит
c70ab152cb
|
@ -466,25 +466,17 @@ Shutdown()
|
||||||
|
|
||||||
RecordBatch::DeleteLog();
|
RecordBatch::DeleteLog();
|
||||||
|
|
||||||
if (gMonitor) {
|
delete gMonitor;
|
||||||
delete gMonitor;
|
gMonitor = nullptr;
|
||||||
gMonitor = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gEventFilter) {
|
delete gEventFilter;
|
||||||
delete gEventFilter;
|
gEventFilter = nullptr;
|
||||||
gEventFilter = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gProfilerStart) {
|
delete gProfilerStart;
|
||||||
delete gProfilerStart;
|
gProfilerStart = nullptr;
|
||||||
gProfilerStart = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gMaxBacklogTime) {
|
delete gMaxBacklogTime;
|
||||||
delete gMaxBacklogTime;
|
gMaxBacklogTime = nullptr;
|
||||||
gMaxBacklogTime = nullptr;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -974,31 +974,27 @@ ShutdownXPCOM(nsIServiceManager* servMgr)
|
||||||
|
|
||||||
NS_IF_RELEASE(gDebug);
|
NS_IF_RELEASE(gDebug);
|
||||||
|
|
||||||
if (sIOThread) {
|
delete sIOThread;
|
||||||
delete sIOThread;
|
sIOThread = nullptr;
|
||||||
sIOThread = nullptr;
|
|
||||||
}
|
delete sMessageLoop;
|
||||||
if (sMessageLoop) {
|
sMessageLoop = nullptr;
|
||||||
delete sMessageLoop;
|
|
||||||
sMessageLoop = nullptr;
|
|
||||||
}
|
|
||||||
if (sCommandLineWasInitialized) {
|
if (sCommandLineWasInitialized) {
|
||||||
CommandLine::Terminate();
|
CommandLine::Terminate();
|
||||||
sCommandLineWasInitialized = false;
|
sCommandLineWasInitialized = false;
|
||||||
}
|
}
|
||||||
if (sExitManager) {
|
|
||||||
delete sExitManager;
|
delete sExitManager;
|
||||||
sExitManager = nullptr;
|
sExitManager = nullptr;
|
||||||
}
|
|
||||||
|
|
||||||
Omnijar::CleanUp();
|
Omnijar::CleanUp();
|
||||||
|
|
||||||
HangMonitor::Shutdown();
|
HangMonitor::Shutdown();
|
||||||
|
|
||||||
if (sMainHangMonitor) {
|
delete sMainHangMonitor;
|
||||||
delete sMainHangMonitor;
|
sMainHangMonitor = nullptr;
|
||||||
sMainHangMonitor = nullptr;
|
|
||||||
}
|
|
||||||
BackgroundHangMonitor::Shutdown();
|
BackgroundHangMonitor::Shutdown();
|
||||||
|
|
||||||
#ifdef MOZ_VISUAL_EVENT_TRACER
|
#ifdef MOZ_VISUAL_EVENT_TRACER
|
||||||
|
|
|
@ -83,9 +83,7 @@ protected:
|
||||||
|
|
||||||
virtual ~BaseStringEnumerator()
|
virtual ~BaseStringEnumerator()
|
||||||
{
|
{
|
||||||
if (mArray) {
|
delete [] mArray;
|
||||||
delete[] mArray;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sort();
|
void Sort();
|
||||||
|
|
|
@ -400,10 +400,8 @@ nsNativeCharsetConverter::GlobalInit()
|
||||||
void
|
void
|
||||||
nsNativeCharsetConverter::GlobalShutdown()
|
nsNativeCharsetConverter::GlobalShutdown()
|
||||||
{
|
{
|
||||||
if (gLock) {
|
delete gLock;
|
||||||
delete gLock;
|
gLock = nullptr;
|
||||||
gLock = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gNativeToUnicode != INVALID_ICONV_T) {
|
if (gNativeToUnicode != INVALID_ICONV_T) {
|
||||||
iconv_close(gNativeToUnicode);
|
iconv_close(gNativeToUnicode);
|
||||||
|
|
|
@ -122,10 +122,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
~AutoCreateAndDestroyReentrantMonitor() {
|
~AutoCreateAndDestroyReentrantMonitor() {
|
||||||
if (*mReentrantMonitorPtr) {
|
delete *mReentrantMonitorPtr;
|
||||||
delete *mReentrantMonitorPtr;
|
*mReentrantMonitorPtr = nullptr;
|
||||||
*mReentrantMonitorPtr = nullptr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Загрузка…
Ссылка в новой задаче