Bug 441197: Explicitly close file descriptors in nsTraceRefcntImpl rather than expecting the OS to clean up properly. r=dbaron
authorKyle Huey <khuey@kylehuey.com>
Fri, 24 Jun 2011 07:22:37 -0700
changeset 71760 3296e9564de671f94131e9844dede8e97c9cb803
parent 71759 7d75aea51d052ea02f7843abeda03d5b1c65d6f3
child 71761 8625f655aeecd626c3029e9a596ff540fc278839
push id20605
push userkhuey@mozilla.com
push dateSat, 25 Jun 2011 17:13:33 +0000
treeherdermozilla-central@82b9558a9eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs441197
milestone7.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 441197: Explicitly close file descriptors in nsTraceRefcntImpl rather than expecting the OS to clean up properly. r=dbaron
xpcom/base/nsTraceRefcntImpl.cpp
--- a/xpcom/base/nsTraceRefcntImpl.cpp
+++ b/xpcom/base/nsTraceRefcntImpl.cpp
@@ -1281,16 +1281,36 @@ nsTraceRefcntImpl::Shutdown()
   if (gObjectsToLog) {
     PL_HashTableDestroy(gObjectsToLog);
     gObjectsToLog = nsnull;
   }
   if (gSerialNumbers) {
     PL_HashTableDestroy(gSerialNumbers);
     gSerialNumbers = nsnull;
   }
+  if (gBloatLog) {
+    fclose(gBloatLog);
+    gBloatLog = nsnull;
+  }
+  if (gRefcntsLog) {
+    fclose(gRefcntsLog);
+    gRefcntsLog = nsnull;
+  }
+  if (gAllocLog) {
+    fclose(gAllocLog);
+    gAllocLog = nsnull;
+  }
+  if (gLeakyLog) {
+    fclose(gLeakyLog);
+    gLeakyLog = nsnull;
+  }
+  if (gCOMPtrLog) {
+    fclose(gCOMPtrLog);
+    gCOMPtrLog = nsnull;
+  }
 #endif
 }
 
 NS_COM void
 nsTraceRefcntImpl::SetActivityIsLegal(PRBool aLegal)
 {
 #ifdef NS_IMPL_REFCNT_LOGGING
   if (gActivityTLS == BAD_TLS_INDEX)