Unregister exported D-Bus objects on finalization
authorJonathan Maw <jonathan.maw@codethink.co.uk>
Thu, 2 Aug 2012 10:10:49 +0000 (11:10 +0100)
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>
Thu, 2 Aug 2012 10:37:11 +0000 (11:37 +0100)
Adds unregistration to the following services:
* legacy app handler
* shutdown client
* node startup controller
* nsm dummy lifecycle control
* nsm dummy consumer

common/shutdown-client.c
node-startup-controller/la-handler-service.c
node-startup-controller/node-startup-controller-service.c
nsm-dummy/nsm-consumer-service.c
nsm-dummy/nsm-lifecycle-control-service.c

index 9343c40..ea5bc9b 100644 (file)
@@ -150,7 +150,10 @@ shutdown_client_finalize (GObject *object)
 
   /* release the consumer, if we have one */
   if (client->consumer != NULL)
-    g_object_unref (client->consumer);
+    {
+      g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (client->consumer));
+      g_object_unref (client->consumer);  
+    }
 
   (*G_OBJECT_CLASS (shutdown_client_parent_class)->finalize) (object);
 }
index 4cc9727..32aa007 100644 (file)
@@ -209,6 +209,9 @@ la_handler_service_finalize (GObject *object)
 {
   LAHandlerService *service = LA_HANDLER_SERVICE (object);
 
+  /* release the interface skeleton */
+  g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (service->interface));
+
   /* release the bus name */
   g_bus_unown_name (service->bus_name_id);
 
index 5e624e8..a0deaa2 100644 (file)
@@ -146,6 +146,7 @@ node_startup_controller_service_finalize (GObject *object)
   g_signal_handlers_disconnect_matched (service->interface,
                                         G_SIGNAL_MATCH_DATA,
                                         0, 0, NULL, NULL, service);
+  g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (service->interface));
   g_object_unref (service->interface);
 
   /* release the current user context */
index 11ebd40..1272758 100644 (file)
@@ -172,6 +172,7 @@ nsm_consumer_service_finalize (GObject *object)
   g_signal_handlers_disconnect_matched (service->interface,
                                         G_SIGNAL_MATCH_DATA,
                                         0, 0, NULL, NULL, service);
+  g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (service->interface));
   g_object_unref (service->interface);
 
   /* release the list of shutdown clients */
index 64dfb33..0b30778 100644 (file)
@@ -136,6 +136,7 @@ nsm_lifecycle_control_service_finalize (GObject *object)
   g_signal_handlers_disconnect_matched (service->interface,
                                         G_SIGNAL_MATCH_DATA,
                                         0, 0, NULL, NULL, service);
+  g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (service->interface));
   g_object_unref (service->interface);
 
   (*G_OBJECT_CLASS (nsm_lifecycle_control_service_parent_class)->finalize) (object);