Skip to content
Commit b7d39dcb authored by Zbigniew Jędrzejewski-Szmek's avatar Zbigniew Jędrzejewski-Szmek
Browse files

core: disable event sources before unreffing them

This mirrors the change done for systemd-resolved in
97935302. Quoting that patch:

> We generally operate on the assumption that a source is "gone" as soon as we
> unref it. This is generally true because we have the only reference. But if
> something else holds the reference, our unref doesn't really stop the source
> and it could fire again.

In particular, we take temporary references from sd-event code, and when called
from an sd-event callback, we could temporarily see this elevated reference
count. This patch doesn't seem to change anything, but I think it's nicer to do
the same change as in other places and not rely on _unref() immediately
disabling the source.

(cherry picked from commit 5dcadb4c)
(cherry picked from commit 67782e10)
(cherry picked from commit 78578b31)
parent 737e1c09
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment