mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1050003
- Remove unnecessary if checks before delete-ing in xpcom/. r=froydnj
This commit is contained in:
parent
3e8abfd2e8
commit
c70ab152cb
@ -466,25 +466,17 @@ Shutdown()
|
||||
|
||||
RecordBatch::DeleteLog();
|
||||
|
||||
if (gMonitor) {
|
||||
delete gMonitor;
|
||||
gMonitor = nullptr;
|
||||
}
|
||||
delete gMonitor;
|
||||
gMonitor = nullptr;
|
||||
|
||||
if (gEventFilter) {
|
||||
delete gEventFilter;
|
||||
gEventFilter = nullptr;
|
||||
}
|
||||
delete gEventFilter;
|
||||
gEventFilter = nullptr;
|
||||
|
||||
if (gProfilerStart) {
|
||||
delete gProfilerStart;
|
||||
gProfilerStart = nullptr;
|
||||
}
|
||||
delete gProfilerStart;
|
||||
gProfilerStart = nullptr;
|
||||
|
||||
if (gMaxBacklogTime) {
|
||||
delete gMaxBacklogTime;
|
||||
gMaxBacklogTime = nullptr;
|
||||
}
|
||||
delete gMaxBacklogTime;
|
||||
gMaxBacklogTime = nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -974,31 +974,27 @@ ShutdownXPCOM(nsIServiceManager* servMgr)
|
||||
|
||||
NS_IF_RELEASE(gDebug);
|
||||
|
||||
if (sIOThread) {
|
||||
delete sIOThread;
|
||||
sIOThread = nullptr;
|
||||
}
|
||||
if (sMessageLoop) {
|
||||
delete sMessageLoop;
|
||||
sMessageLoop = nullptr;
|
||||
}
|
||||
delete sIOThread;
|
||||
sIOThread = nullptr;
|
||||
|
||||
delete sMessageLoop;
|
||||
sMessageLoop = nullptr;
|
||||
|
||||
if (sCommandLineWasInitialized) {
|
||||
CommandLine::Terminate();
|
||||
sCommandLineWasInitialized = false;
|
||||
}
|
||||
if (sExitManager) {
|
||||
delete sExitManager;
|
||||
sExitManager = nullptr;
|
||||
}
|
||||
|
||||
delete sExitManager;
|
||||
sExitManager = nullptr;
|
||||
|
||||
Omnijar::CleanUp();
|
||||
|
||||
HangMonitor::Shutdown();
|
||||
|
||||
if (sMainHangMonitor) {
|
||||
delete sMainHangMonitor;
|
||||
sMainHangMonitor = nullptr;
|
||||
}
|
||||
delete sMainHangMonitor;
|
||||
sMainHangMonitor = nullptr;
|
||||
|
||||
BackgroundHangMonitor::Shutdown();
|
||||
|
||||
#ifdef MOZ_VISUAL_EVENT_TRACER
|
||||
|
@ -83,9 +83,7 @@ protected:
|
||||
|
||||
virtual ~BaseStringEnumerator()
|
||||
{
|
||||
if (mArray) {
|
||||
delete[] mArray;
|
||||
}
|
||||
delete [] mArray;
|
||||
}
|
||||
|
||||
void Sort();
|
||||
|
@ -400,10 +400,8 @@ nsNativeCharsetConverter::GlobalInit()
|
||||
void
|
||||
nsNativeCharsetConverter::GlobalShutdown()
|
||||
{
|
||||
if (gLock) {
|
||||
delete gLock;
|
||||
gLock = nullptr;
|
||||
}
|
||||
delete gLock;
|
||||
gLock = nullptr;
|
||||
|
||||
if (gNativeToUnicode != INVALID_ICONV_T) {
|
||||
iconv_close(gNativeToUnicode);
|
||||
|
@ -122,10 +122,8 @@ public:
|
||||
}
|
||||
|
||||
~AutoCreateAndDestroyReentrantMonitor() {
|
||||
if (*mReentrantMonitorPtr) {
|
||||
delete *mReentrantMonitorPtr;
|
||||
*mReentrantMonitorPtr = nullptr;
|
||||
}
|
||||
delete *mReentrantMonitorPtr;
|
||||
*mReentrantMonitorPtr = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user