udev: do not call sd_event_source_disable_unref() in workers for event sources created by the main process

Fixes a bug introduced by 9612da361a.
This commit is contained in:
Yu Watanabe
2022-03-29 10:29:44 +02:00
committed by Zbigniew Jędrzejewski-Szmek
parent 8166950763
commit f777e745a7
+4 -2
View File
@@ -210,8 +210,10 @@ DEFINE_PRIVATE_HASH_OPS_WITH_VALUE_DESTRUCTOR(worker_hash_op, void, trivial_hash
static void manager_clear_for_worker(Manager *manager) {
assert(manager);
manager->inotify_event = sd_event_source_disable_unref(manager->inotify_event);
manager->kill_workers_event = sd_event_source_disable_unref(manager->kill_workers_event);
/* Do not use sd_event_source_disable_unref() here, as this is called by both workers and the
* main process. */
manager->inotify_event = sd_event_source_unref(manager->inotify_event);
manager->kill_workers_event = sd_event_source_unref(manager->kill_workers_event);
manager->event = sd_event_unref(manager->event);