mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1019913 - If gBloatView fails, call |maybeUnregisterAndCloseFile()| on gBloatLog instead of setting it to NULL. r=nfroyd
This commit is contained in:
parent
49c8453a1e
commit
732ff5129e
@ -715,6 +715,19 @@ HashNumber(const void* aKey)
|
||||
return PLHashNumber(NS_PTR_TO_INT32(aKey));
|
||||
}
|
||||
|
||||
static void
|
||||
maybeUnregisterAndCloseFile(FILE*& aFile)
|
||||
{
|
||||
if (!aFile) {
|
||||
return;
|
||||
}
|
||||
|
||||
MozillaUnRegisterDebugFILE(aFile);
|
||||
fclose(aFile);
|
||||
aFile = nullptr;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
InitTraceLog()
|
||||
{
|
||||
@ -731,7 +744,7 @@ InitTraceLog()
|
||||
RecreateBloatView();
|
||||
if (!gBloatView) {
|
||||
NS_WARNING("out of memory");
|
||||
gBloatLog = nullptr;
|
||||
maybeUnregisterAndCloseFile(gBloatLog);
|
||||
gLogLeaksOnly = false;
|
||||
}
|
||||
}
|
||||
@ -1272,18 +1285,6 @@ nsTraceRefcnt::Startup()
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
maybeUnregisterAndCloseFile(FILE*& aFile)
|
||||
{
|
||||
if (!aFile) {
|
||||
return;
|
||||
}
|
||||
|
||||
MozillaUnRegisterDebugFILE(aFile);
|
||||
fclose(aFile);
|
||||
aFile = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
nsTraceRefcnt::Shutdown()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user