diff options
author | Federico Mena Quintero <federico@ximian.com> | 2001-02-21 06:35:49 +0800 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2001-02-21 06:35:49 +0800 |
commit | a056c8466d7bb0dfaef2170a983b7d43398b086f (patch) | |
tree | 233b2fda1c572419880dc742b44c122ff9c03358 /wombat | |
parent | dae9728b0d2a4c24b8ddc1a8a45a3e2ca02c18bf (diff) | |
download | gsoc2013-evolution-a056c8466d7bb0dfaef2170a983b7d43398b086f.tar gsoc2013-evolution-a056c8466d7bb0dfaef2170a983b7d43398b086f.tar.gz gsoc2013-evolution-a056c8466d7bb0dfaef2170a983b7d43398b086f.tar.bz2 gsoc2013-evolution-a056c8466d7bb0dfaef2170a983b7d43398b086f.tar.lz gsoc2013-evolution-a056c8466d7bb0dfaef2170a983b7d43398b086f.tar.xz gsoc2013-evolution-a056c8466d7bb0dfaef2170a983b7d43398b086f.tar.zst gsoc2013-evolution-a056c8466d7bb0dfaef2170a983b7d43398b086f.zip |
Unref the factories if we failed to initialize anything. (setup_pcs): Call
2001-02-16 Federico Mena Quintero <federico@ximian.com>
* wombat.c (main): Unref the factories if we failed to initialize
anything.
(setup_pcs): Call cal_factory_oaf_register(). Removed the OAF
registration code from here; now it is in the CalFactory itself.
svn path=/trunk/; revision=8309
Diffstat (limited to 'wombat')
-rw-r--r-- | wombat/ChangeLog | 7 | ||||
-rw-r--r-- | wombat/wombat.c | 44 |
2 files changed, 20 insertions, 31 deletions
diff --git a/wombat/ChangeLog b/wombat/ChangeLog index e05e509123..9eb9dea30e 100644 --- a/wombat/ChangeLog +++ b/wombat/ChangeLog @@ -1,3 +1,10 @@ +2001-02-16 Federico Mena Quintero <federico@ximian.com> + + * wombat.c (main): Unref the factories if we failed to initialize + anything. + (setup_pcs): Call cal_factory_oaf_register(). Removed the OAF + registration code from here; now it is in the CalFactory itself. + 2001-02-12 Kjartan Maraas <kmaraas@gnome.org> * Makefile.am: xml-i18n-tools setup. diff --git a/wombat/wombat.c b/wombat/wombat.c index 83a442acc7..fb3bfc5ab2 100644 --- a/wombat/wombat.c +++ b/wombat/wombat.c @@ -111,37 +111,10 @@ last_calendar_gone_cb (CalFactory *factory, gpointer data) queue_termination (); } -static gboolean -register_pcs (CORBA_Object obj) -{ - OAF_RegistrationResult result; - - result = oaf_active_server_register - ("OAFIID:GNOME_Evolution_Wombat_CalendarFactory", - obj); - - switch (result) { - case OAF_REG_SUCCESS: - return TRUE; /* Wooho! */ - case OAF_REG_NOT_LISTED: - g_message ("Cannot register the PCS because not listed"); - return FALSE; - case OAF_REG_ALREADY_ACTIVE: - g_message ("Cannot register the PCS because already active"); - return FALSE; - case OAF_REG_ERROR: - default: - g_message ("Cannot register the PCS because we suck"); - return FALSE; - } -} - /* Creates the calendar factory object and registers it */ static gboolean setup_pcs (int argc, char **argv) { - CORBA_Object object; - cal_factory = cal_factory_new (); if (!cal_factory) { @@ -151,9 +124,7 @@ setup_pcs (int argc, char **argv) cal_factory_register_method (cal_factory, "file", CAL_BACKEND_FILE_TYPE); - object = bonobo_object_corba_objref (BONOBO_OBJECT (cal_factory)); - - if (!register_pcs (object)) { + if (!cal_factory_oaf_register (cal_factory)) { bonobo_object_unref (BONOBO_OBJECT (cal_factory)); cal_factory = NULL; return FALSE; @@ -225,7 +196,18 @@ main (int argc, char **argv) if (!(setup_pas (argc, argv) && setup_pcs (argc, argv) && setup_config (argc, argv))) { - g_message ("main(): could not initialize all of the Wombat services"); + g_message ("main(): could not initialize all of the Wombat services; terminating"); + + if (pas_book_factory) { + bonobo_object_unref (BONOBO_OBJECT (pas_book_factory)); + pas_book_factory = NULL; + } + + if (cal_factory) { + bonobo_object_unref (BONOBO_OBJECT (cal_factory)); + cal_factory = NULL; + } + exit (EXIT_FAILURE); } |