Bug 494412 – Make error message more clear when we can't load xpcom due to lack of memory. r=benjamin

This commit is contained in:
Hiroyuki Ikezoe 2009-08-08 12:34:10 +09:00
parent 828209d4e2
commit 331b166366

View File

@ -431,7 +431,14 @@ main(int argc, char **argv)
rv = XPCOMGlueStartup(greDir);
if (NS_FAILED(rv)) {
Output(PR_TRUE, "Couldn't load XPCOM.\n");
if (rv == NS_ERROR_OUT_OF_MEMORY) {
char applicationName[2000] = "this application";
parser.GetString("App", "Name", applicationName, sizeof(applicationName));
Output(PR_TRUE, "Not enough memory available to start %s.\n",
applicationName);
} else {
Output(PR_TRUE, "Couldn't load XPCOM.\n");
}
return 1;
}