mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 01:47:58 +02:00
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:
parent
8de09bb119
commit
1f856b7cb3
1 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue