Removing the watch_all callback



Hi,

It looks like hal_deinit() needs to remove the watch_all callback
that is being installed in hal_init().  The patch below will do
this.

Unfortunately that API does not yet exist in HAL.  I've
submitted that back to the HAL mailing list.  Details are here:
http://lists.freedesktop.org/archives/hal/2009-April/013157.html

I discovered this during my stress testing of continually restarting
HAL.  Eventually, libhal would fail on the 
libhal_device_property_watch_all() call in hal_init().  With this
patch (and the corresponding one in my HAL library) I was able to
restart HAL 1000 times with no issues.

Drew



diff --git a/src/nm-hal-manager.c b/src/nm-hal-manager.c
index 0ed0f5d..cf6f200 100644
--- a/src/nm-hal-manager.c
+++ b/src/nm-hal-manager.c
@@ -711,6 +711,11 @@ hal_deinit (NMHalManager *self)
 	NMHalManagerPrivate *priv = NM_HAL_MANAGER_GET_PRIVATE (self);
 	DBusError error;
 
+	libhal_device_property_remove_watch_all (priv->hal_ctx, &error);
+	if (dbus_error_is_set (&error)) {
+		nm_error ("libhal_device_property_remove_watch_all(): %s", error.message);
+	}
+
 	if (priv->killswitch_poll_id) {
 		g_source_remove (priv->killswitch_poll_id);
 		priv->killswitch_poll_id = 0;


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