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.
This commit is contained in:
Thomas Haller 2016-05-30 13:34:54 +02:00
parent 7d808e523b
commit e1d5b27c4f
3 changed files with 10 additions and 1 deletions

View file

@ -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;
}

View file

@ -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);
}

View file

@ -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