bluez5: fix crash on DBus transport disconnection

Do not register dbus notification if message failed to be sent out
because transport was already disconnected
This commit is contained in:
Kuba Pawlak 2016-11-10 10:22:45 +01:00 committed by Denis Kenzior
parent 5a6fe84ec0
commit de58109933
1 changed files with 4 additions and 2 deletions

View File

@ -155,8 +155,10 @@ void bt_unregister_profile(DBusConnection *conn, const char *object)
return;
}
dbus_pending_call_set_notify(c, unregister_profile_cb, NULL, NULL);
dbus_pending_call_unref(c);
if (c) {
dbus_pending_call_set_notify(c, unregister_profile_cb, NULL, NULL);
dbus_pending_call_unref(c);
}
dbus_message_unref(msg);
}