From e1d5b27c4f3be39de2affba5697982cfccf14be8 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 30 May 2016 13:34:54 +0200 Subject: [PATCH] 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. --- src/dns-manager/nm-dns-manager.c | 1 + src/dns-manager/nm-dns-plugin.c | 8 +++++++- src/dns-manager/nm-dns-plugin.h | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) 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