mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-10-28 23:12:17 +01:00 
			
		
		
		
	gsignalgroup: make GSignalGroup.dispose() a bit more reentrant
dispose() would previously set the "handlers" pointer to NULL. But
dispose() also calls g_signal_group_gc_handlers(), which requires this
pointer to be not NULL.
This means, dispose() could not be called multiple times. Which is a
good practice to allow, because g_object_run_dispose() and object
resurrection both requires that dispose() can be called more than once
per object.
Fix that problem, by leaving the array until finalize().
Fixes: dd43471f60 ('gobject: add GSignalGroup')
			
			
This commit is contained in:
		| @@ -527,7 +527,7 @@ g_signal_group_dispose (GObject *object) | ||||
|   if (self->has_bound_at_least_once) | ||||
|     g_signal_group_unbind (self); | ||||
|  | ||||
|   g_clear_pointer (&self->handlers, g_ptr_array_unref); | ||||
|   g_ptr_array_set_size (self->handlers, 0); | ||||
|  | ||||
|   g_rec_mutex_unlock (&self->mutex); | ||||
|  | ||||
| @@ -541,6 +541,7 @@ g_signal_group_finalize (GObject *object) | ||||
|  | ||||
|   g_weak_ref_clear (&self->target_ref); | ||||
|   g_rec_mutex_clear (&self->mutex); | ||||
|   g_ptr_array_unref (self->handlers); | ||||
|  | ||||
|   G_OBJECT_CLASS (g_signal_group_parent_class)->finalize (object); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user