Bug 1050003 - Remove unnecessary if checks before delete-ing in xpcom/. r=froydnj

This commit is contained in:
Birunthan Mohanathas 2014-08-08 07:04:45 -07:00
Родитель 3e8abfd2e8
Коммит c70ab152cb
5 изменённых файлов: 25 добавлений и 43 удалений

Просмотреть файл

@ -466,25 +466,17 @@ Shutdown()
RecordBatch::DeleteLog();
if (gMonitor) {
delete gMonitor;
gMonitor = nullptr;
}
if (gEventFilter) {
delete gEventFilter;
gEventFilter = nullptr;
}
if (gProfilerStart) {
delete gProfilerStart;
gProfilerStart = nullptr;
}
if (gMaxBacklogTime) {
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;
}
if (sCommandLineWasInitialized) {
CommandLine::Terminate();
sCommandLineWasInitialized = false;
}
if (sExitManager) {
delete sExitManager;
sExitManager = nullptr;
}
Omnijar::CleanUp();
HangMonitor::Shutdown();
if (sMainHangMonitor) {
delete sMainHangMonitor;
sMainHangMonitor = nullptr;
}
BackgroundHangMonitor::Shutdown();
#ifdef MOZ_VISUAL_EVENT_TRACER

Просмотреть файл

@ -83,10 +83,8 @@ protected:
virtual ~BaseStringEnumerator()
{
if (mArray) {
delete [] mArray;
}
}
void Sort();

Просмотреть файл

@ -400,10 +400,8 @@ nsNativeCharsetConverter::GlobalInit()
void
nsNativeCharsetConverter::GlobalShutdown()
{
if (gLock) {
delete gLock;
gLock = nullptr;
}
if (gNativeToUnicode != INVALID_ICONV_T) {
iconv_close(gNativeToUnicode);

Просмотреть файл

@ -122,11 +122,9 @@ public:
}
~AutoCreateAndDestroyReentrantMonitor() {
if (*mReentrantMonitorPtr) {
delete *mReentrantMonitorPtr;
*mReentrantMonitorPtr = nullptr;
}
}
private:
ReentrantMonitor** mReentrantMonitorPtr;