hal/hald/linux bus_device.c, 1.7, 1.8 class_device.c, 1.12, 1.13 common.c, 1.6, 1.7

Joe Shaw joe at pdx.freedesktop.org
Mon Apr 26 13:42:15 PDT 2004


Update of /cvs/hal/hal/hald/linux
In directory pdx:/tmp/cvs-serv22484/hald/linux

Modified Files:
	bus_device.c class_device.c common.c 
Log Message:
2004-04-26  Joe Shaw  <joe at ximian.com>

	* hald/callout.c (hal_callout_device): We still need to emit the
	callouts_finished signal even if we have no callouts.  Whoops.

	* hald/bus_device.c (bus_device_got_parent): We don't need to ref
	the device being added, since it's no longer unconditionally being
	unreffed immediately afterward.

	* hald/class_device.c (class_device_final): Ditto.

	* hald/common.c (device_move_from_tdl_to_gdl): Remove the ref note
	in the comment, and call g_object_ref() at the top of the
	function.

Index: bus_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/bus_device.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- a/bus_device.c	26 Apr 2004 20:08:58 -0000	1.7
+++ b/bus_device.c	26 Apr 2004 20:42:13 -0000	1.8
@@ -185,7 +185,7 @@
 
 		self->got_udi (self, device_to_add, new_udi);
 
-		g_signal_connect (g_object_ref (device_to_add),
+		g_signal_connect (device_to_add,
 				  "callouts_finished",
 				  G_CALLBACK (device_move_from_tdl_to_gdl),
 				  NULL);

Index: class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/class_device.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- a/class_device.c	26 Apr 2004 20:08:58 -0000	1.12
+++ b/class_device.c	26 Apr 2004 20:42:13 -0000	1.13
@@ -434,7 +434,7 @@
 
 			self->got_udi (self, device_to_add, new_udi);
 
-			g_signal_connect (g_object_ref (device_to_add),
+			g_signal_connect (device_to_add,
 					  "callouts_finished",
 					  G_CALLBACK (device_move_from_tdl_to_gdl),
 					  NULL);

Index: common.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/common.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- a/common.c	26 Apr 2004 20:08:58 -0000	1.6
+++ b/common.c	26 Apr 2004 20:42:13 -0000	1.7
@@ -827,8 +827,7 @@
 
 /** Removes the device from the TDL and adds it to the GDL when all
  *  all of the device's callouts have finished.  This is a gobject
- *  signal callback.  NOTE!  The device must be reffed, since this
- *  callback unrefs it, to ensure lifetime safety.
+ *  signal callback. 
  *
  *  @param  device              The device being moved
  *  @param  user_data           User data provided when connecting the signal
@@ -837,6 +836,7 @@
 void
 device_move_from_tdl_to_gdl (HalDevice *device, gpointer user_data)
 {
+	g_object_ref (device);
 	hal_device_store_remove (hald_get_tdl (), device);
 	hal_device_store_add (hald_get_gdl (), device);
 	g_signal_handlers_disconnect_by_func (device,





More information about the hal-commit mailing list