From: Dirk-Jan C. Binnema Date: Fri, 6 Jul 2007 07:10:51 +0000 (+0000) Subject: * unitialize modest-window-mgr before the other singletons, so X-Git-Tag: git_migration_finished~2935 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=781806c53992ccec3456d5fa90c0f319edae7667 * unitialize modest-window-mgr before the other singletons, so it can still save it's settings etc. in its finalize (this was causing GLib-Criticals upon exit in some cases, as well as forgetting settings) * before doing gtk_main_quit in modest-window-mgr, check that we haven't already done that (not sure if we actually *ever* should call gtk_main_quit there, but at least now this clears up another Glib-Critical upon exit in some cases pmo-trunk-r2603 --- diff --git a/src/modest-singletons.c b/src/modest-singletons.c index 5998e5e..e756b11 100644 --- a/src/modest-singletons.c +++ b/src/modest-singletons.c @@ -166,7 +166,13 @@ modest_singletons_finalize (GObject *obj) ModestSingletonsPrivate *priv; priv = MODEST_SINGLETONS_GET_PRIVATE(obj); - + + if (priv->window_mgr) { + modest_runtime_verify_object_last_ref(priv->window_mgr,""); + g_object_unref (G_OBJECT(priv->window_mgr)); + priv->window_mgr = NULL; + } + if (priv->account_store) { modest_runtime_verify_object_last_ref(priv->account_store,""); g_object_unref (G_OBJECT(priv->account_store)); @@ -179,12 +185,6 @@ modest_singletons_finalize (GObject *obj) priv->email_clipboard = NULL; } - if (priv->conf) { - modest_runtime_verify_object_last_ref(priv->conf,""); - g_object_unref (G_OBJECT(priv->conf)); - priv->conf = NULL; - } - if (priv->cache_mgr) { modest_runtime_verify_object_last_ref(priv->cache_mgr,""); g_object_unref (G_OBJECT(priv->cache_mgr)); @@ -218,13 +218,13 @@ modest_singletons_finalize (GObject *obj) g_object_unref (G_OBJECT(priv->account_mgr)); priv->account_mgr = NULL; } - - if (priv->window_mgr) { - modest_runtime_verify_object_last_ref(priv->window_mgr,""); - g_object_unref (G_OBJECT(priv->window_mgr)); - priv->window_mgr = NULL; + + if (priv->conf) { + modest_runtime_verify_object_last_ref(priv->conf,""); + g_object_unref (G_OBJECT(priv->conf)); + priv->conf = NULL; } - + G_OBJECT_CLASS(parent_class)->finalize (obj); } diff --git a/src/widgets/modest-window-mgr.c b/src/widgets/modest-window-mgr.c index 1cb1ae7..ca27a2c 100644 --- a/src/widgets/modest-window-mgr.c +++ b/src/widgets/modest-window-mgr.c @@ -496,7 +496,9 @@ modest_window_mgr_unregister_window (ModestWindowMgr *self, priv->show_toolbars, NULL); /* Quit main loop */ - gtk_main_quit (); + /* FIXME: do we ever need to do this here? */ + if (gtk_main_level() > 0) + gtk_main_quit (); } }