aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-04-21 18:02:51 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2016-04-21 18:02:51 +0200
commit10ce08a3706339eb354296ce7c0101f0b1df1acf (patch)
tree9cdc1f605c081bc0b5d1af97752d2d2af377d840
parent2ddd0a58dae834f173277e51488f6ba30f1cad6a (diff)
cleaner cleanup
Change-Id: I5c7db64bcaf0757db33e3b96cf12890d98ef87a1 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/utils-jbus.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/utils-jbus.c b/src/utils-jbus.c
index 3bea2c2..408d65c 100644
--- a/src/utils-jbus.c
+++ b/src/utils-jbus.c
@@ -719,9 +719,20 @@ void jbus_addref(struct jbus *jbus)
void jbus_unref(struct jbus *jbus)
{
struct jservice *srv;
+ struct jsignal *sig;
+ struct jrespw *wtr;
if (!--jbus->refcount) {
if (jbus->connection != NULL)
dbus_connection_unref(jbus->connection);
+ while ((wtr = jbus->waiters) != NULL) {
+ jbus->waiters = wtr->next;
+ free(wtr);
+ }
+ while ((sig = jbus->signals) != NULL) {
+ jbus->signals = sig->next;
+ free(sig->name);
+ free(sig);
+ }
while ((srv = jbus->services) != NULL) {
jbus->services = srv->next;
free(srv->method);