From 960011b6e24b5a0c14c7cdfc8f0ec230d63c0b49 Mon Sep 17 00:00:00 2001 From: Benjamin Smedberg Date: Tue, 26 Jan 2010 15:50:53 -0500 Subject: [PATCH] Bug 535564 yet another attempt - Don't inherit the leak log handle from parent to child processes: Java spawns a process which holds this handle alive beyond our shutdown, causing our test harnesses to be unable to delete it, r?jgriffin --- xpcom/base/nsTraceRefcntImpl.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xpcom/base/nsTraceRefcntImpl.cpp b/xpcom/base/nsTraceRefcntImpl.cpp index 6c79f2f3b46a..db3a834c551d 100644 --- a/xpcom/base/nsTraceRefcntImpl.cpp +++ b/xpcom/base/nsTraceRefcntImpl.cpp @@ -620,6 +620,12 @@ static PRBool LogThisObj(PRInt32 aSerialNumber) return nsnull != PL_HashTableLookup(gObjectsToLog, (const void*)(aSerialNumber)); } +#ifdef XP_WIN +#define FOPEN_NO_INHERIT "N" +#else +#define FOPEN_NO_INHERIT +#endif + static PRBool InitLog(const char* envVar, const char* msg, FILE* *result) { const char* value = getenv(envVar); @@ -653,7 +659,7 @@ static PRBool InitLog(const char* envVar, const char* msg, FILE* *result) fname.AppendLiteral(".log"); } #endif - stream = ::fopen(fname.get(), "w"); + stream = ::fopen(fname.get(), "w" FOPEN_NO_INHERIT); if (stream != NULL) { *result = stream; fprintf(stdout, "### %s defined -- logging %s to %s\n",