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.

(cherry picked from commit 1f856b7cb3)
(cherry picked from commit a3c73e783b)
(cherry picked from commit 6858e794f3)
This commit is contained in:
Thomas Haller 2018-10-03 15:37:36 +02:00
parent deedb10600
commit 391587731c

View file

@ -1130,9 +1130,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)
_emit_config_change (ndisc, changed);
if (nextevent != G_MAXINT32) {
if (nextevent <= now)
g_return_if_reached ();
@ -1140,6 +1137,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)
_emit_config_change (ndisc, changed);
}
static gboolean