Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/4] Do not automatically remove watches for service names
@ 2010-09-06 10:26 Luiz Augusto von Dentz
  2010-09-06 10:26 ` [PATCH 2/4] Fix signal watch when a service name is given Luiz Augusto von Dentz
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2010-09-06 10:26 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto Von Dentz <luiz.dentz-von@nokia.com>

Services can be owned again so it is perfectly fine to keep the watch.
---
 gdbus/watch.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/gdbus/watch.c b/gdbus/watch.c
index 29f23e2..b686c85 100644
--- a/gdbus/watch.c
+++ b/gdbus/watch.c
@@ -386,18 +386,19 @@ static DBusHandlerResult service_filter(DBusConnection *connection,
 				cb->conn_func(connection, cb->user_data);
 		}
 
+		/* Only auto remove if it is a bus name watch */
+		if (data->argument[0] == ':' &&
+				(!cb->conn_func || !cb->disc_func)) {
+			filter_data_remove_callback(data, cb);
+			continue;
+		}
+
 		/* Check if the watch was removed/freed by the callback
 		 * function */
 		if (!g_slist_find(data->callbacks, cb))
 			continue;
 
 		data->callbacks = g_slist_remove(data->callbacks, cb);
-
-		if (!cb->conn_func || !cb->disc_func) {
-			g_free(cb);
-			continue;
-		}
-
 		data->processed = g_slist_append(data->processed, cb);
 	}
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH 1/4] Do not automatically remove watches for service names
@ 2010-03-01 16:07 Luiz Augusto von Dentz
  0 siblings, 0 replies; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2010-03-01 16:07 UTC (permalink / raw)
  To: linux-bluetooth, ofono

Services can be owned again so it is perfectly fine to keep the watch.
---
 gdbus/watch.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/gdbus/watch.c b/gdbus/watch.c
index 1d479fa..e85f288 100644
--- a/gdbus/watch.c
+++ b/gdbus/watch.c
@@ -386,18 +386,19 @@ static DBusHandlerResult
service_filter(DBusConnection *connection,
 				cb->conn_func(connection, cb->user_data);
 		}

+		/* Only auto remove if it is a bus name watch */
+		if (data->argument[0] == ':' &&
+				(!cb->conn_func || !cb->disc_func)) {
+			filter_data_remove_callback(data, cb);
+			continue;
+		}
+
 		/* Check if the watch was removed/freed by the callback
 		 * function */
 		if (!g_slist_find(data->callbacks, cb))
 			continue;

 		data->callbacks = g_slist_remove(data->callbacks, cb);
-
-		if (!cb->conn_func || !cb->disc_func) {
-			g_free(cb);
-			continue;
-		}
-
 		data->processed = g_slist_append(data->processed, cb);
 	}

-- 
Luiz Augusto von Dentz
Computer Engineer

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

end of thread, other threads:[~2010-09-07 20:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-06 10:26 [PATCH 1/4] Do not automatically remove watches for service names Luiz Augusto von Dentz
2010-09-06 10:26 ` [PATCH 2/4] Fix signal watch when a service name is given Luiz Augusto von Dentz
2010-09-06 10:26 ` [PATCH 3/4] Fix calling watch callbacks after it has been removed Luiz Augusto von Dentz
2010-09-06 13:39   ` Luiz Augusto von Dentz
2010-09-06 10:26 ` [PATCH 4/4] Make use of ofono bus name when watching its signals Luiz Augusto von Dentz
2010-09-07 20:50 ` [PATCH 1/4] Do not automatically remove watches for service names Johan Hedberg
  -- strict thread matches above, loose matches on Subject: below --
2010-03-01 16:07 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