[glib] gdbus: fix false positive g_warning() in remove_filter()
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gdbus: fix false positive g_warning() in remove_filter()
- Date: Sat, 8 Apr 2017 05:13:20 +0000 (UTC)
commit 005dfeacba142af598d57f28da1e7f79c17d8fe1
Author: Ole André Vadla Ravnås <oleavr gmail com>
Date: Wed Mar 1 11:18:21 2017 +0100
gdbus: fix false positive g_warning() in remove_filter()
The GDBus thread might be holding a ref while requesting to remove the
filter.
https://bugzilla.gnome.org/show_bug.cgi?id=779409
gio/gdbusconnection.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index 17b0741..7c88a4e 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -3175,18 +3175,21 @@ g_dbus_connection_remove_filter (GDBusConnection *connection,
guint filter_id)
{
guint n;
+ gboolean found;
FilterData *to_destroy;
g_return_if_fail (G_IS_DBUS_CONNECTION (connection));
g_return_if_fail (check_initialized (connection));
CONNECTION_LOCK (connection);
+ found = FALSE;
to_destroy = NULL;
for (n = 0; n < connection->filters->len; n++)
{
FilterData *data = connection->filters->pdata[n];
if (data->id == filter_id)
{
+ found = TRUE;
g_ptr_array_remove_index (connection->filters, n);
data->ref_count--;
if (data->ref_count == 0)
@@ -3204,7 +3207,7 @@ g_dbus_connection_remove_filter (GDBusConnection *connection,
g_main_context_unref (to_destroy->context);
g_free (to_destroy);
}
- else
+ else if (!found)
{
g_warning ("g_dbus_connection_remove_filter: No filter found for filter_id %d", filter_id);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]