aboutsummaryrefslogtreecommitdiffstats
path: root/mail/component-factory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/component-factory.c')
-rw-r--r--mail/component-factory.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/mail/component-factory.c b/mail/component-factory.c
index e193fec3c6..5d47f42d31 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -729,9 +729,13 @@ owner_set_cb (EvolutionShellComponent *shell_component,
static void
free_storage (gpointer service, gpointer storage, gpointer data)
{
- camel_service_disconnect (CAMEL_SERVICE (service), TRUE, NULL);
- camel_object_unref (CAMEL_OBJECT (service));
- bonobo_object_unref (BONOBO_OBJECT (storage));
+ if (service) {
+ camel_service_disconnect (CAMEL_SERVICE (service), TRUE, NULL);
+ camel_object_unref (CAMEL_OBJECT (service));
+ }
+
+ if (storage)
+ bonobo_object_unref (BONOBO_OBJECT (storage));
}
static void