summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-objects.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-10-14 19:53:56 +0200
committerLennart Poettering <lennart@poettering.net>2013-10-14 19:53:56 +0200
commit8ce2afd6347dcf01e33fe1ff257e2b0fffa8edfe (patch)
treef90e1b693239377c283be59ead467993887c5ec2 /src/libsystemd-bus/bus-objects.c
parentd68888227d2e1093f8e18753ba2e10a1cab7c6ad (diff)
bus: make sure that we always keep a ref to the bus when we dispatch callbacks
Otherwise the callback might unref the bus we are processing and destroy the object while we are processing it.
Diffstat (limited to 'src/libsystemd-bus/bus-objects.c')
-rw-r--r--src/libsystemd-bus/bus-objects.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libsystemd-bus/bus-objects.c b/src/libsystemd-bus/bus-objects.c
index cd56d13d6b..9142fab37a 100644
--- a/src/libsystemd-bus/bus-objects.c
+++ b/src/libsystemd-bus/bus-objects.c
@@ -1843,6 +1843,7 @@ int sd_bus_emit_properties_changed_strv(
const char *interface,
char **names) {
+ BUS_DONT_DESTROY(bus);
char *prefix;
int r;
@@ -1987,6 +1988,8 @@ static int interfaces_added_append_one(
}
int sd_bus_emit_interfaces_added_strv(sd_bus *bus, const char *path, char **interfaces) {
+ BUS_DONT_DESTROY(bus);
+
_cleanup_bus_message_unref_ sd_bus_message *m = NULL;
char **i;
int r;