summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/udev/udevd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 144a20ec63..2bb322796b 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -293,6 +293,8 @@ static void manager_free(Manager *manager) {
if (!manager)
return;
+ manager->monitor = sd_device_monitor_unref(manager->monitor);
+
udev_builtin_exit();
if (manager->pid == getpid_cached())
@@ -789,8 +791,6 @@ static void manager_exit(Manager *manager) {
manager->inotify_event = sd_event_source_unref(manager->inotify_event);
manager->fd_inotify = safe_close(manager->fd_inotify);
- manager->monitor = sd_device_monitor_unref(manager->monitor);
-
/* discard queued events and kill workers */
event_queue_cleanup(manager, EVENT_QUEUED);
manager_kill_workers(manager);