diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-12-03 05:49:44 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-12-03 05:50:53 +0800 |
commit | ba05eccc8d0595fd229a25b5a62f302abe7ef479 (patch) | |
tree | 6cf06e4297523a1722fdb068ff193a90dc0d8456 /shell/e-shell.c | |
parent | 86770f6b7749b08a2b7867979a2c9726941ed52e (diff) | |
download | gsoc2013-evolution-ba05eccc8d0595fd229a25b5a62f302abe7ef479.tar gsoc2013-evolution-ba05eccc8d0595fd229a25b5a62f302abe7ef479.tar.gz gsoc2013-evolution-ba05eccc8d0595fd229a25b5a62f302abe7ef479.tar.bz2 gsoc2013-evolution-ba05eccc8d0595fd229a25b5a62f302abe7ef479.tar.lz gsoc2013-evolution-ba05eccc8d0595fd229a25b5a62f302abe7ef479.tar.xz gsoc2013-evolution-ba05eccc8d0595fd229a25b5a62f302abe7ef479.tar.zst gsoc2013-evolution-ba05eccc8d0595fd229a25b5a62f302abe7ef479.zip |
Revise the EShell ref-leak check to not upset Valgrind.
Diffstat (limited to 'shell/e-shell.c')
-rw-r--r-- | shell/e-shell.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/shell/e-shell.c b/shell/e-shell.c index 130e0f0912..157e003799 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -91,8 +91,8 @@ static GDebugKey debug_keys[] = { { "settings", DEBUG_KEY_SETTINGS } }; -EShell *default_shell = NULL; static gpointer parent_class; +static gpointer default_shell; static guint signals[LAST_SIGNAL]; #if defined(NM_SUPPORT) && NM_SUPPORT @@ -624,8 +624,10 @@ static void shell_constructed (GObject *object) { /* The first EShell instance is the default. */ - if (default_shell == NULL) - default_shell = g_object_ref (object); + if (default_shell == NULL) { + default_shell = object; + g_object_add_weak_pointer (object, &default_shell); + } /* UniqueApp will have by this point determined whether we're * the only Evolution process running. If so, proceed normally. @@ -1148,9 +1150,6 @@ e_shell_get_type (void) EShell * e_shell_get_default (void) { - /* Emit a warning if we call this too early. */ - g_return_val_if_fail (default_shell != NULL, NULL); - return default_shell; } |