summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-06 23:59:07 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-07 00:13:58 +0100
commitb7484e2a58038c57591457c1439505607bdcd833 (patch)
tree0d4de763a26ec05e87bdc0ba203a955f19653334 /src/libsystemd-bus
parent5b84559a76f30755019d6a0e6b2ccc9bbe0b3c56 (diff)
event: make sure we keep a reference to all events we dispatch while we do so.
Diffstat (limited to 'src/libsystemd-bus')
-rw-r--r--src/libsystemd-bus/sd-event.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libsystemd-bus/sd-event.c b/src/libsystemd-bus/sd-event.c
index 9c641c9a8e..97e6db289b 100644
--- a/src/libsystemd-bus/sd-event.c
+++ b/src/libsystemd-bus/sd-event.c
@@ -1614,6 +1614,8 @@ static int source_dispatch(sd_event_source *s) {
return r;
}
+ sd_event_source_ref(s);
+
switch (s->type) {
case SOURCE_IO:
@@ -1645,6 +1647,8 @@ static int source_dispatch(sd_event_source *s) {
break;
}
+ sd_event_source_unref(s);
+
return r;
}