ndisc: first reschedule timeout before invoking change event in check_timestamps()

It's just ugly to invoke external code in the middel of an operation.
You never know, whether the handler won' unref the ndisc instance.
This commit is contained in:
Thomas Haller 2018-10-03 15:37:36 +02:00
parent 8de09bb119
commit 1f856b7cb3

View file

@ -1132,9 +1132,6 @@ check_timestamps (NMNDisc *ndisc, gint32 now, NMNDiscConfigMap changed)
clean_dns_servers (ndisc, now, &changed, &nextevent);
clean_dns_domains (ndisc, now, &changed, &nextevent);
if (changed)
nm_ndisc_emit_config_change (ndisc, changed);
if (nextevent != G_MAXINT32) {
if (nextevent <= now)
g_return_if_reached ();
@ -1142,6 +1139,9 @@ check_timestamps (NMNDisc *ndisc, gint32 now, NMNDiscConfigMap changed)
(int) (nextevent - now));
priv->timeout_id = g_timeout_add_seconds (nextevent - now, timeout_cb, ndisc);
}
if (changed)
nm_ndisc_emit_config_change (ndisc, changed);
}
static gboolean