Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/5] Fix handling of dbus signals
@ 2011-10-21 17:58 Lucas De Marchi
  2011-10-21 17:58 ` [PATCH 2/5] Add missing TRACK-REACHED-START event Lucas De Marchi
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Lucas De Marchi @ 2011-10-21 17:58 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lucas De Marchi

We're previously leaking a D-Bus message and always returning that
the signal was not handled.
---
 test/mpris-player.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/test/mpris-player.c b/test/mpris-player.c
index 29bea46..4592e5d 100644
--- a/test/mpris-player.c
+++ b/test/mpris-player.c
@@ -549,7 +549,7 @@ static DBusHandlerResult properties_changed(DBusConnection *conn,
 	if (!signal) {
 		fprintf(stderr, "Unable to allocate new PropertyChanged"
 							" signal\n");
-		goto done;
+		goto err;
 	}
 
 	dbus_message_iter_init_append(signal, &entry);
@@ -563,13 +563,19 @@ static DBusHandlerResult properties_changed(DBusConnection *conn,
 	dbus_message_iter_next(&iter);
 
 	if (parse_metadata(&iter, &metadata) < 0)
-		goto done;
+		goto err;
 
 	dbus_message_iter_close_container(&entry, &metadata);
 
 	dbus_connection_send(sys, signal, NULL);
+	dbus_message_unref(signal);
+	g_free(path);
 
-done:
+	return DBUS_HANDLER_RESULT_HANDLED;
+
+err:
+	if (signal)
+		dbus_message_unref(signal);
 	g_free(path);
 	return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
@@ -607,7 +613,7 @@ static DBusHandlerResult session_filter(DBusConnection *conn,
 		add_player(conn, name, new);
 	}
 
-	return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+	return DBUS_HANDLER_RESULT_HANDLED;
 }
 
 static DBusHandlerResult system_filter(DBusConnection *conn,
@@ -633,7 +639,7 @@ static DBusHandlerResult system_filter(DBusConnection *conn,
 		__io_terminated = 1;
 	}
 
-	return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+	return DBUS_HANDLER_RESULT_HANDLED;
 }
 
 static char *get_default_adapter(DBusConnection *conn)
-- 
1.7.7


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-10-22 10:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-21 17:58 [PATCH 1/5] Fix handling of dbus signals Lucas De Marchi
2011-10-21 17:58 ` [PATCH 2/5] Add missing TRACK-REACHED-START event Lucas De Marchi
2011-10-22 10:09   ` Luiz Augusto von Dentz
2011-10-21 17:58 ` [PATCH 3/5] Fix leak of GTimer Lucas De Marchi
2011-10-22 10:10   ` Luiz Augusto von Dentz
2011-10-21 17:58 ` [PATCH 4/5] Unregister players' events when disconnected Lucas De Marchi
2011-10-22 10:10   ` Luiz Augusto von Dentz
2011-10-22 10:21   ` Johan Hedberg
2011-10-21 17:58 ` [PATCH 5/5] AVRCP: handle volume up/down keys as TG Lucas De Marchi
2011-10-22 10:19   ` Luiz Augusto von Dentz
2011-10-22 10:09 ` [PATCH 1/5] Fix handling of dbus signals Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox