Search
SailfishOS Open Build Service
>
Projects
>
home:plfiorini
:
maui:devel
:
hw:lge:hammerhead
>
bluez
> _service:tar_git:bluetoothd-startup-dbus-crash-fix.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File _service:tar_git:bluetoothd-startup-dbus-crash-fix.patch of Package bluez
diff -Naur bluez.orig/gdbus/watch.c bluez/gdbus/watch.c --- bluez.orig/gdbus/watch.c 2013-10-29 07:24:48.891641000 +0000 +++ bluez/gdbus/watch.c 2013-11-15 02:02:51.000000000 +0000 @@ -42,6 +42,10 @@ static guint listener_id = 0; static GSList *listeners = NULL; +/*Add this flag to avoid call dbus_connection_remove_filter() twice*/ +static gboolean msg_filter_need_free = FALSE; + + struct service_data { DBusConnection *conn; @@ -205,9 +209,11 @@ const char *name = NULL, *owner = NULL; if (filter_data_find(connection, NULL, NULL, NULL, NULL, NULL, NULL) == NULL) { + msg_filter_need_free = TRUE; if (!dbus_connection_add_filter(connection, message_filter, NULL, NULL)) { error("dbus_connection_add_filter() failed"); + msg_filter_need_free = FALSE; return NULL; } } @@ -381,10 +387,11 @@ /* Remove filter if there are no listeners left for the connection */ data = filter_data_find(connection, NULL, NULL, NULL, NULL, NULL, NULL); - if (data == NULL) + if ((data == NULL) && msg_filter_need_free) { + msg_filter_need_free = FALSE; dbus_connection_remove_filter(connection, message_filter, NULL); - + } dbus_connection_unref(connection); return TRUE;