mirror of
https://git.proxmox.com/git/fwupd
synced 2025-05-29 06:30:19 +00:00
Fix a crash when using fu_plugin_device_add_delay()
By removing the device from the hash table before we add it to the devices array we could inadvertently drop the last object reference if the plugin is not using the (optional) cache. Just re-arrange things to fix https://github.com/hughsie/fwupd/issues/259
This commit is contained in:
parent
daa341720f
commit
0dec274e56
@ -372,8 +372,8 @@ static gboolean
|
|||||||
fu_plugin_device_add_delay_cb (gpointer user_data)
|
fu_plugin_device_add_delay_cb (gpointer user_data)
|
||||||
{
|
{
|
||||||
FuPluginHelper *helper = (FuPluginHelper *) user_data;
|
FuPluginHelper *helper = (FuPluginHelper *) user_data;
|
||||||
g_hash_table_remove (helper->devices, helper->device);
|
|
||||||
fu_plugin_device_add (helper->plugin, helper->device);
|
fu_plugin_device_add (helper->plugin, helper->device);
|
||||||
|
g_hash_table_remove (helper->devices, helper->device);
|
||||||
fu_plugin_helper_free (helper);
|
fu_plugin_helper_free (helper);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user