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)
Loading
Please register or sign in to comment