]> www.fi.muni.cz Git - evince.git/commitdiff
Replace exit() with gtk_main_quit()
authorMiguel de Icaza <miguel@gnu.org>
Mon, 23 Aug 1999 06:19:24 +0000 (06:19 +0000)
committerArturo Espinosa <unammx@src.gnome.org>
Mon, 23 Aug 1999 06:19:24 +0000 (06:19 +0000)
1999-08-23  Miguel de Icaza  <miguel@gnu.org>

* bonobo-image-x-pdf.cc: Replace exit() with gtk_main_quit()

pdf/xpdf/ChangeLog
pdf/xpdf/bonobo-image-x-pdf.cc

index 9f4772c7c0f6d7be6ce518caf37e2d9d38047ba0..ca4b0a4f1d86accb0bd626982125da3808d76b9a 100644 (file)
@@ -1,3 +1,7 @@
+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
index 8d49a33530bdb1920b1071ec02bf3cc16591a03e..04c905212f467496217a4addbc5dcd0c2ea28208 100644 (file)
@@ -47,6 +47,19 @@ GBool printCommands = gFalse;
 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
  */
@@ -276,6 +289,13 @@ extern "C" {
     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
@@ -717,6 +737,8 @@ embeddable_factory (GnomeEmbeddableFactory *This, void *data)
          GTK_OBJECT (embeddable), "destroy",
          GTK_SIGNAL_FUNC (destroy_embed), bed);
 
+       embeddable_servers++;
+
        /* Setup some verbs */
        gnome_embeddable_add_verb (embeddable,
                                   "FirstPage",
@@ -741,8 +763,6 @@ embeddable_factory (GnomeEmbeddableFactory *This, void *data)
 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);