mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-13 17:23:20 +00:00
Cancel the file monitor before disposal to avoid a potential deadlock
Fixes https://github.com/fwupd/fwupd/issues/2350
This commit is contained in:
parent
409a2c958c
commit
0b6f58394b
@ -27,8 +27,10 @@ fu_plugin_destroy (FuPlugin *plugin)
|
||||
FuPluginData *data = fu_plugin_get_data (plugin);
|
||||
if (data->file != NULL)
|
||||
g_object_unref (data->file);
|
||||
if (data->monitor != NULL)
|
||||
if (data->monitor != NULL) {
|
||||
g_file_monitor_cancel (data->monitor);
|
||||
g_object_unref (data->monitor);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -28,8 +28,10 @@ fu_plugin_destroy (FuPlugin *plugin)
|
||||
FuPluginData *data = fu_plugin_get_data (plugin);
|
||||
if (data->file != NULL)
|
||||
g_object_unref (data->file);
|
||||
if (data->monitor != NULL)
|
||||
if (data->monitor != NULL) {
|
||||
g_file_monitor_cancel (data->monitor);
|
||||
g_object_unref (data->monitor);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -27,8 +27,10 @@ fu_plugin_destroy (FuPlugin *plugin)
|
||||
FuPluginData *data = fu_plugin_get_data (plugin);
|
||||
if (data->file != NULL)
|
||||
g_object_unref (data->file);
|
||||
if (data->monitor != NULL)
|
||||
if (data->monitor != NULL) {
|
||||
g_file_monitor_cancel (data->monitor);
|
||||
g_object_unref (data->monitor);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -672,6 +672,8 @@ update_context_free (UpdateContext *ctx)
|
||||
if (ctx == NULL)
|
||||
return;
|
||||
|
||||
g_file_monitor_cancel (ctx->monitor);
|
||||
|
||||
g_object_unref (ctx->bed);
|
||||
g_object_unref (ctx->plugin);
|
||||
g_object_unref (ctx->monitor);
|
||||
|
@ -313,8 +313,10 @@ fu_config_finalize (GObject *obj)
|
||||
{
|
||||
FuConfig *self = FU_CONFIG (obj);
|
||||
|
||||
if (self->monitor != NULL)
|
||||
if (self->monitor != NULL) {
|
||||
g_file_monitor_cancel (self->monitor);
|
||||
g_object_unref (self->monitor);
|
||||
}
|
||||
g_ptr_array_unref (self->disabled_devices);
|
||||
g_ptr_array_unref (self->disabled_plugins);
|
||||
g_ptr_array_unref (self->approved_firmware);
|
||||
|
@ -1678,8 +1678,10 @@ fu_main_private_free (FuMainPrivate *priv)
|
||||
g_object_unref (priv->connection);
|
||||
if (priv->authority != NULL)
|
||||
g_object_unref (priv->authority);
|
||||
if (priv->argv0_monitor != NULL)
|
||||
if (priv->argv0_monitor != NULL) {
|
||||
g_file_monitor_cancel (priv->argv0_monitor);
|
||||
g_object_unref (priv->argv0_monitor);
|
||||
}
|
||||
if (priv->introspection_daemon != NULL)
|
||||
g_dbus_node_info_unref (priv->introspection_daemon);
|
||||
#if GLIB_CHECK_VERSION(2,63,3)
|
||||
|
@ -475,11 +475,18 @@ fu_remote_list_class_init (FuRemoteListClass *klass)
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
fu_remote_list_monitor_unref (GFileMonitor *monitor)
|
||||
{
|
||||
g_file_monitor_cancel (monitor);
|
||||
g_object_unref (monitor);
|
||||
}
|
||||
|
||||
static void
|
||||
fu_remote_list_init (FuRemoteList *self)
|
||||
{
|
||||
self->array = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
|
||||
self->monitors = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
|
||||
self->monitors = g_ptr_array_new_with_free_func ((GDestroyNotify) fu_remote_list_monitor_unref);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user