summaryrefslogtreecommitdiff
path: root/src/settings/plugins/ifnet/nms-ifnet-plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings/plugins/ifnet/nms-ifnet-plugin.c')
-rw-r--r--src/settings/plugins/ifnet/nms-ifnet-plugin.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/settings/plugins/ifnet/nms-ifnet-plugin.c b/src/settings/plugins/ifnet/nms-ifnet-plugin.c
index 5d5d79bffa..00af56c408 100644
--- a/src/settings/plugins/ifnet/nms-ifnet-plugin.c
+++ b/src/settings/plugins/ifnet/nms-ifnet-plugin.c
@@ -118,6 +118,13 @@ file_changed (GFileMonitor * monitor,
}
}
+static void
+_weak_ref_cb (gpointer data,
+ GObject *where_the_object_was)
+{
+ g_free (data);
+}
+
static GFileMonitor *
monitor_file_changes (const char *filename,
FileChangedFn callback, gpointer user_data)
@@ -137,10 +144,10 @@ monitor_file_changes (const char *filename,
info = g_new0 (FileMonitorInfo, 1);
info->callback = callback;
info->user_data = user_data;
- g_object_weak_ref (G_OBJECT (monitor), (GWeakNotify) g_free,
- info);
+ g_object_weak_ref (G_OBJECT (monitor), _weak_ref_cb,
+ info);
g_signal_connect (monitor, "changed", G_CALLBACK (file_changed),
- info);
+ info);
} else {
nm_log_warn (LOGD_SETTINGS, "Monitoring %s failed, error: %s", filename,
error == NULL ? "nothing" : (*error)->message);