+1999-08-23 Miguel de Icaza <miguel@gnu.org>
+
+ * bonobo-image-x-pdf.cc: Replace exit() with gtk_main_quit()
+
1999-08-22 Miguel de Icaza <miguel@gnu.org>
* bonobo-image-x-pdf.cc (main): Add error checking for factory
CORBA_Environment ev;
CORBA_ORB orb;
+/*
+ * Number of servers running on the system
+ * when the count reaches zero, we unregister from the
+ * Name Server and we shut down.
+ */
+static int embeddable_servers = 0;
+
+/*
+ * Our embeddable factory
+ */
+static GnomeEmbeddableFactory *factory;
+
+
/*
* BonoboObject data
*/
gtk_object_unref (GTK_OBJECT (bed->stream));
bed->stream = NULL;
g_free (bed);
+
+ embeddable_servers--;
+
+ if (embeddable_servers == 0){
+ gnome_object_unref (GNOME_OBJECT (factory));
+ gtk_main_quit ();
+ }
}
static void
GTK_OBJECT (embeddable), "destroy",
GTK_SIGNAL_FUNC (destroy_embed), bed);
+ embeddable_servers++;
+
/* Setup some verbs */
gnome_embeddable_add_verb (embeddable,
"FirstPage",
static gboolean
init_bonobo_image_x_pdf_factory (void)
{
- GnomeEmbeddableFactory *factory;
-
factory = gnome_embeddable_factory_new (
"bonobo-object-factory:image-x-pdf",
embeddable_factory, NULL);