Change 'debugexit' to quit main loop rather than exit(), add cleanup

A new envrionment variable GNOME_SHELL_ENABLE_CLEANUP is added which
causes us to attempt freeing global data.  The reason this isn't
enabled by default is that it's a waste of time at best, and at
worst in corner cases could cause crashes which would fill up
crash databases.  Better to leave it as a developer-only tool.

Start stubbing out some cleanup in ShellGlobal.

https://bugzilla.gnome.org/show_bug.cgi?id=649517
This commit is contained in:
Colin Walters
2011-05-05 18:09:59 -04:00
parent bfd344cdec
commit a8baf4a2a2
3 changed files with 28 additions and 4 deletions

View File

@ -453,6 +453,7 @@ main (int argc, char **argv)
{
GOptionContext *ctx;
GError *error = NULL;
int ecode;
g_type_init ();
@ -507,5 +508,13 @@ main (int argc, char **argv)
/* Initialize the global object */
shell_global_get ();
return meta_run ();
ecode = meta_run ();
if (g_getenv ("GNOME_SHELL_ENABLE_CLEANUP"))
{
g_printerr ("Doing final cleanup...\n");
g_object_unref (shell_global_get ());
}
return ecode;
}