summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-05-30 13:34:54 +0200
committerThomas Haller <thaller@redhat.com>2016-06-01 12:12:18 +0200
commite1d5b27c4f3be39de2affba5697982cfccf14be8 (patch)
treeeae6f12b99ff476c1ace42d863a30ef458856586
parent7d808e523b8a1704c31801521447611d7a952878 (diff)
downloadNetworkManager-e1d5b27c4f3be39de2affba5697982cfccf14be8.tar.gz
dns: explicitly stop DNS plugin in manager
_clear_plugin() should explicitly stop the DNS plugin, instead of just unreferencing it. Unreferencing does not necessarily mean, that the plugin will be destroyed right away.
-rw-r--r--src/dns-manager/nm-dns-manager.c1
-rw-r--r--src/dns-manager/nm-dns-plugin.c8
-rw-r--r--src/dns-manager/nm-dns-plugin.h2
3 files changed, 10 insertions, 1 deletions
diff --git a/src/dns-manager/nm-dns-manager.c b/src/dns-manager/nm-dns-manager.c
index 07fcc22122..971906e083 100644
--- a/src/dns-manager/nm-dns-manager.c
+++ b/src/dns-manager/nm-dns-manager.c
@@ -1493,6 +1493,7 @@ _clear_plugin (NMDnsManager *self)
if (priv->plugin) {
g_signal_handlers_disconnect_by_func (priv->plugin, plugin_failed, self);
g_signal_handlers_disconnect_by_func (priv->plugin, plugin_child_quit, self);
+ nm_dns_plugin_stop (priv->plugin);
g_clear_object (&priv->plugin);
return TRUE;
}
diff --git a/src/dns-manager/nm-dns-plugin.c b/src/dns-manager/nm-dns-plugin.c
index b9e6e8bf07..f065a1ceca 100644
--- a/src/dns-manager/nm-dns-plugin.c
+++ b/src/dns-manager/nm-dns-plugin.c
@@ -254,6 +254,12 @@ nm_dns_plugin_child_kill (NMDnsPlugin *self)
return TRUE;
}
+void
+nm_dns_plugin_stop (NMDnsPlugin *self)
+{
+ nm_dns_plugin_child_kill (self);
+}
+
/********************************************/
static void
@@ -266,7 +272,7 @@ dispose (GObject *object)
{
NMDnsPlugin *self = NM_DNS_PLUGIN (object);
- nm_dns_plugin_child_kill (self);
+ nm_dns_plugin_stop (self);
G_OBJECT_CLASS (nm_dns_plugin_parent_class)->dispose (object);
}
diff --git a/src/dns-manager/nm-dns-plugin.h b/src/dns-manager/nm-dns-plugin.h
index a5eb741ae7..4c84b1457d 100644
--- a/src/dns-manager/nm-dns-plugin.h
+++ b/src/dns-manager/nm-dns-plugin.h
@@ -90,6 +90,8 @@ gboolean nm_dns_plugin_update (NMDnsPlugin *self,
const NMGlobalDnsConfig *global_config,
const char *hostname);
+void nm_dns_plugin_stop (NMDnsPlugin *self);
+
/* For subclasses/plugins */
/* Spawn a child process and watch for it to quit. 'argv' is the NULL-terminated