mirror of
				https://git.proxmox.com/git/fwupd
				synced 2025-11-04 08:59:20 +00:00 
			
		
		
		
	trivial: Always clear the mutex before clearing the thing it protects
This commit is contained in:
		
							parent
							
								
									11c5941f23
								
							
						
					
					
						commit
						aae22e4df5
					
				@ -3230,6 +3230,9 @@ fu_device_finalize (GObject *object)
 | 
			
		||||
	FuDevice *self = FU_DEVICE (object);
 | 
			
		||||
	FuDevicePrivate *priv = GET_PRIVATE (self);
 | 
			
		||||
 | 
			
		||||
	g_rw_lock_clear (&priv->metadata_mutex);
 | 
			
		||||
	g_rw_lock_clear (&priv->parent_guids_mutex);
 | 
			
		||||
 | 
			
		||||
	if (priv->alternate != NULL)
 | 
			
		||||
		g_object_unref (priv->alternate);
 | 
			
		||||
	if (priv->parent != NULL)
 | 
			
		||||
@ -3242,8 +3245,6 @@ fu_device_finalize (GObject *object)
 | 
			
		||||
		g_source_remove (priv->poll_id);
 | 
			
		||||
	if (priv->metadata != NULL)
 | 
			
		||||
		g_hash_table_unref (priv->metadata);
 | 
			
		||||
	g_rw_lock_clear (&priv->metadata_mutex);
 | 
			
		||||
	g_rw_lock_clear (&priv->parent_guids_mutex);
 | 
			
		||||
	g_ptr_array_unref (priv->children);
 | 
			
		||||
	g_ptr_array_unref (priv->parent_guids);
 | 
			
		||||
	g_ptr_array_unref (priv->possible_plugins);
 | 
			
		||||
 | 
			
		||||
@ -2774,6 +2774,8 @@ fu_plugin_finalize (GObject *object)
 | 
			
		||||
	FuPluginPrivate *priv = GET_PRIVATE (self);
 | 
			
		||||
	FuPluginInitFunc func = NULL;
 | 
			
		||||
 | 
			
		||||
	g_rw_lock_clear (&priv->devices_mutex);
 | 
			
		||||
 | 
			
		||||
	/* optional */
 | 
			
		||||
	if (priv->module != NULL) {
 | 
			
		||||
		g_module_symbol (priv->module, "fu_plugin_destroy", (gpointer *) &func);
 | 
			
		||||
@ -2805,7 +2807,6 @@ fu_plugin_finalize (GObject *object)
 | 
			
		||||
		g_hash_table_unref (priv->report_metadata);
 | 
			
		||||
	if (priv->devices != NULL)
 | 
			
		||||
		g_hash_table_unref (priv->devices);
 | 
			
		||||
	g_rw_lock_clear (&priv->devices_mutex);
 | 
			
		||||
	g_free (priv->build_hash);
 | 
			
		||||
	g_free (priv->name);
 | 
			
		||||
	g_free (priv->data);
 | 
			
		||||
 | 
			
		||||
@ -947,11 +947,12 @@ fu_device_list_finalize (GObject *obj)
 | 
			
		||||
{
 | 
			
		||||
	FuDeviceList *self = FU_DEVICE_LIST (obj);
 | 
			
		||||
 | 
			
		||||
	g_rw_lock_clear (&self->devices_mutex);
 | 
			
		||||
 | 
			
		||||
	if (self->replug_id != 0)
 | 
			
		||||
		g_source_remove (self->replug_id);
 | 
			
		||||
	g_ptr_array_unref (self->devices);
 | 
			
		||||
	g_main_loop_unref (self->replug_loop);
 | 
			
		||||
	g_rw_lock_clear (&self->devices_mutex);
 | 
			
		||||
 | 
			
		||||
	G_OBJECT_CLASS (fu_device_list_parent_class)->finalize (obj);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1082,9 +1082,10 @@ fu_history_finalize (GObject *object)
 | 
			
		||||
{
 | 
			
		||||
	FuHistory *self = FU_HISTORY (object);
 | 
			
		||||
 | 
			
		||||
	g_rw_lock_clear (&self->db_mutex);
 | 
			
		||||
 | 
			
		||||
	if (self->db != NULL)
 | 
			
		||||
		sqlite3_close (self->db);
 | 
			
		||||
	g_rw_lock_clear (&self->db_mutex);
 | 
			
		||||
 | 
			
		||||
	G_OBJECT_CLASS (fu_history_parent_class)->finalize (object);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -222,8 +222,8 @@ fu_idle_finalize (GObject *obj)
 | 
			
		||||
	FuIdle *self = FU_IDLE (obj);
 | 
			
		||||
 | 
			
		||||
	fu_idle_stop (self);
 | 
			
		||||
	g_ptr_array_unref (self->items);
 | 
			
		||||
	g_rw_lock_clear (&self->items_mutex);
 | 
			
		||||
	g_ptr_array_unref (self->items);
 | 
			
		||||
 | 
			
		||||
	G_OBJECT_CLASS (fu_idle_parent_class)->finalize (obj);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user