bonobo-activation; freeing base services ...



	Sorry to spam you - this seems to kill most of the
bonobo-activation related referencing issues, by freeing the base
services.

	Regards,

		Michael.

? mjs
? bonobo-activation-0.7.0.tar.gz
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/bonobo-activation/ChangeLog,v
retrieving revision 1.235
diff -u -r1.235 ChangeLog
--- ChangeLog	2001/10/25 09:16:35	1.235
+++ ChangeLog	2001/10/26 06:00:15
@@ -1,3 +1,17 @@
+2001-10-27  Michael Meeks  <michael ximian com>
+
+	* bonobo-activation/bonobo-activation-base-service.c
+	(bonobo_activation_base_service_shutdown): impl.
+
+	* bonobo-activation/bonobo-activation-init.c
+	(bonobo_activation_shutdown): use it.
+
+2001-10-27  Michael Meeks  <michael ximian com>
+
+	* bonobo-activation/bonobo-activation-init.c
+	(bonobo_activation_shutdown): impl. to cleanup floating
+	resources.
+
 2001-10-26  Michael Meeks  <michael ximian com>

 	* bonobo-activation/bonobo-activation-shlib.c
Index: bonobo-activation/bonobo-activation-base-service.c
===================================================================
RCS file: /cvs/gnome/bonobo-activation/bonobo-activation/bonobo-activation-base-service.c,v
retrieving revision 1.33
diff -u -r1.33 bonobo-activation-base-service.c
--- bonobo-activation/bonobo-activation-base-service.c	2001/09/27 06:14:03	1.33
+++ bonobo-activation/bonobo-activation-base-service.c	2001/10/26 06:00:37
@@ -268,6 +268,32 @@
 	return CORBA_OBJECT_NIL;
 }

+void
+bonobo_activation_base_service_shutdown (CORBA_Environment *ev)
+{
+        int i;
+
+	for (i = 0; activatable_servers[i].name; i++) {
+                GSList *l, *instances;
+
+                instances = activatable_servers[i].instances;
+                activatable_servers[i].instances = NULL;
+
+                for (l = instances; l; l = l->next) {
+                        struct SysServerInstance *ssi;
+
+                        ssi = l->data;
+
+                        CORBA_Object_release (ssi->already_running, ev);
+                        g_free (ssi->username);
+                        g_free (ssi->hostname);
+                        g_free (ssi->domain);
+                        g_free (ssi);
+                }
+                g_slist_free (instances);
+        }
+}
+
 static void
 bonobo_activation_existing_set (const BonoboActivationBaseService *base_service, struct SysServer *ss,
 	          CORBA_Object obj, CORBA_Environment *ev)
Index: bonobo-activation/bonobo-activation-base-service.h
===================================================================
RCS file: /cvs/gnome/bonobo-activation/bonobo-activation/bonobo-activation-base-service.h,v
retrieving revision 1.5
diff -u -r1.5 bonobo-activation-base-service.h
--- bonobo-activation/bonobo-activation-base-service.h	2001/08/18 00:19:02	1.5
+++ bonobo-activation/bonobo-activation-base-service.h	2001/10/26 06:00:37
@@ -77,6 +77,7 @@
                                                            gpointer                      user_data);
 CORBA_Object bonobo_activation_base_service_check         (const BonoboActivationBaseService         *base_service,
                                                            CORBA_Environment            *ev);
+void         bonobo_activation_base_service_shutdown      (CORBA_Environment            *ev);
 void         bonobo_activation_base_service_set           (const BonoboActivationBaseService         *base_service,
                                                            CORBA_Object                  obj,
                                                            CORBA_Environment            *ev);
Index: bonobo-activation/bonobo-activation-init.c
===================================================================
RCS file: /cvs/gnome/bonobo-activation/bonobo-activation/bonobo-activation-init.c,v
retrieving revision 1.40
diff -u -r1.40 bonobo-activation-init.c
--- bonobo-activation/bonobo-activation-init.c	2001/09/10 23:44:53	1.40
+++ bonobo-activation/bonobo-activation-init.c	2001/10/26 06:00:40
@@ -534,6 +534,43 @@
 	return bonobo_activation_orb;
 }

+int
+bonobo_activation_shutdown (void)
+{
+        int retval = 0;
+
+        if (is_initialized) {
+                CORBA_Environment ev;
+
+                CORBA_exception_init (&ev);
+
+                bonobo_activation_base_service_shutdown (&ev);
+                if (ev._major != CORBA_NO_EXCEPTION)
+                        retval = 1;
+
+                if (bonobo_activation_context != CORBA_OBJECT_NIL) {
+                        CORBA_Object_release (
+                                (CORBA_Object) bonobo_activation_context, &ev);
+                        bonobo_activation_context = CORBA_OBJECT_NIL;
+                }
+
+                if (bonobo_activation_orb != CORBA_OBJECT_NIL) {
+                        CORBA_ORB_destroy (bonobo_activation_orb, &ev);
+                        if (ev._major != CORBA_NO_EXCEPTION)
+                                retval = 1;
+                        CORBA_Object_release (
+                                (CORBA_Object) bonobo_activation_orb, &ev);
+                        is_initialized = FALSE;
+                }
+
+                CORBA_exception_free (&ev);
+
+        } else /* shutdown when we didn't need to error */
+		retval = 1;
+
+        return retval;
+}
+
 const char  bonobo_activation_version []    = VERSION;
 const guint bonobo_activation_major_version = BONOBO_ACTIVATION_MAJOR_VERSION;
 const guint bonobo_activation_minor_version = BONOBO_ACTIVATION_MINOR_VERSION;
Index: bonobo-activation/bonobo-activation-init.h
===================================================================
RCS file: /cvs/gnome/bonobo-activation/bonobo-activation/bonobo-activation-init.h,v
retrieving revision 1.4
diff -u -r1.4 bonobo-activation-init.h
--- bonobo-activation/bonobo-activation-init.h	2001/08/18 00:19:02	1.4
+++ bonobo-activation/bonobo-activation-init.h	2001/10/26 06:00:40
@@ -38,6 +38,7 @@
 gboolean       bonobo_activation_is_initialized   (void);
 CORBA_ORB      bonobo_activation_init       (int      argc,
                                              char   **argv);
+int            bonobo_activation_shutdown   (void);
 void           bonobo_activation_preinit    (gpointer app,
                                              gpointer mod_info);
 void           bonobo_activation_postinit   (gpointer app,

-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]