diff options
author | Tom Gundersen <teg@jklm.no> | 2015-10-09 21:36:04 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-10-11 14:21:41 +0200 |
commit | 7d20d3759e375367c36471906ba898c6909d5132 (patch) | |
tree | d259ca62a37256753f3f37d1763de136224f52ff | |
parent | f0213e3796b4dd66e546e2de4d677db319f9171b (diff) |
networkd: manager - free bus after own objects
Freeing links/addresses may trigger sending signals over the bus, so let's make sure
the bus stays around until our own objects have been freed.
-rw-r--r-- | src/network/networkd-manager.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c index b4259cafef..e42f2a4c1e 100644 --- a/src/network/networkd-manager.c +++ b/src/network/networkd-manager.c @@ -477,14 +477,6 @@ void manager_free(Manager *m) { free(m->state_file); - sd_event_source_unref(m->udev_event_source); - udev_monitor_unref(m->udev_monitor); - udev_unref(m->udev); - - sd_bus_unref(m->bus); - sd_bus_slot_unref(m->prepare_for_sleep_slot); - sd_event_source_unref(m->bus_retry_event_source); - while ((link = hashmap_first(m->links))) link_unref(link); hashmap_free(m->links); @@ -504,6 +496,14 @@ void manager_free(Manager *m) { sd_netlink_unref(m->rtnl); sd_event_unref(m->event); + sd_event_source_unref(m->udev_event_source); + udev_monitor_unref(m->udev_monitor); + udev_unref(m->udev); + + sd_bus_unref(m->bus); + sd_bus_slot_unref(m->prepare_for_sleep_slot); + sd_event_source_unref(m->bus_retry_event_source); + free(m); } |