Bug 362318 (patch from bug 326837) invalid warnings on startup about static objects, r=sspitzer

git-svn-id: svn://10.0.0.236/trunk@220592 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
benjamin%smedbergs.us
2007-02-20 19:42:12 +00:00
parent eb773195b7
commit 34613c4dad

View File

@@ -949,11 +949,21 @@ ScopedXPCOMStartup::SetWindowCreator(nsINativeAppSupport* native)
return wwatch->SetWindowCreator(creator);
}
/**
* A helper class which calls NS_LogTerm/NS_LogTerm in it's scope.
*/
class ScopedLogging
{
public:
ScopedLogging() { NS_LogInit(); }
~ScopedLogging() { NS_LogTerm(); }
};
static void DumpArbitraryHelp()
{
nsresult rv;
NS_LogInit();
ScopedLogging log;
{
nsXREDirProvider dirProvider;
@@ -973,8 +983,6 @@ static void DumpArbitraryHelp()
if (NS_SUCCEEDED(rv))
printf("%s", text.get());
}
NS_LogTerm();
}
// English text needs to go into a dtd file.
@@ -2303,6 +2311,8 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
}
}
ScopedLogging log;
if (!appData.xreDirectory) {
nsCOMPtr<nsILocalFile> lf;
rv = XRE_GetBinaryPath(gArgv[0], getter_AddRefs(lf));
@@ -2390,8 +2400,6 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
gArgc = argc = NS_TraceMallocStartupArgs(gArgc, gArgv);
#endif
NS_LogInit();
{
nsXREDirProvider dirProvider;
rv = dirProvider.Initialize(gAppData->directory, gAppData->xreDirectory);
@@ -2928,7 +2936,5 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
}
}
NS_LogTerm();
return NS_FAILED(rv) ? 1 : 0;
}