X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-singletons.c;h=76f6ec19e6fa0341a6b2cbb180adcfbe786052b1;hp=7be780a7cce5813648c3b4ee914abc0457d985d6;hb=7df38f78cb5481006cbd14cb24cc5abb8f0226f9;hpb=cc379b2109f5c1b1a70419454d1a0e53c26559e6 diff --git a/src/modest-singletons.c b/src/modest-singletons.c index 7be780a..76f6ec1 100644 --- a/src/modest-singletons.c +++ b/src/modest-singletons.c @@ -31,7 +31,11 @@ #include "modest-runtime.h" #include "modest-defs.h" #include "modest-debug.h" +#ifdef MODEST_TOOLKIT_HILDON2 +#include "hildon2/modest-hildon2-window-mgr.h" +#else #include "widgets/modest-hildon1-window-mgr.h" +#endif #include /* 'private'/'protected' functions */ @@ -163,7 +167,11 @@ modest_singletons_init (ModestSingletons *obj) return; } +#if MODEST_TOOLKIT_HILDON2 + priv->window_mgr = modest_hildon2_window_mgr_new (); +#else priv->window_mgr = modest_hildon1_window_mgr_new (); +#endif if (!priv->window_mgr) { g_printerr ("modest: cannot create modest window manager instance\n"); return; @@ -234,6 +242,18 @@ modest_singletons_finalize (GObject *obj) priv->email_clipboard = NULL; } + if (priv->plugin_factory) { + MODEST_DEBUG_VERIFY_OBJECT_LAST_REF(priv->plugin_factory,""); + g_object_unref (G_OBJECT(priv->plugin_factory)); + priv->plugin_factory = NULL; + } + + if (priv->protocol_registry) { + MODEST_DEBUG_VERIFY_OBJECT_LAST_REF(priv->protocol_registry,""); + g_object_unref (G_OBJECT(priv->protocol_registry)); + priv->protocol_registry = NULL; + } + /* It is important that the account manager is uninitialized after * the mail op queue is uninitialized because the mail op queue * cancells any mail operations which in turn access the account