OSDN Git Service

core: Fix g_source_remove() with zero ID while removing device
authorAnderson Lizardo <anderson.lizardo@openbossa.org>
Tue, 29 Jan 2013 18:52:26 +0000 (14:52 -0400)
committerJohan Hedberg <johan.hedberg@intel.com>
Tue, 29 Jan 2013 21:59:13 +0000 (15:59 -0600)
commit4cc7c23afb3377baca418b2a5b6a3ebd58d570c0
treeb24913a42c3ac5bca8a2a3c5dd848611006d5ef2
parente897eaaa9f01f37a03fef5577ba01e1424fc8f55
core: Fix g_source_remove() with zero ID while removing device

store_device_info_cb() is also used as callback for g_idle_add() and
therefore sets device->store_id to zero. During device removal it may be
called manually, which must be done only after the existing
device->store_id is removed from mainloop.

Fix this GLib error (and a bunch of invalid read/writes when
store_device_info_cb() was called after device removal due to this bug):

bluetoothd[1192]: src/device.c:device_remove() Removing device
/org/bluez/hci0/dev_12_34_12_34_12_34

(bluetoothd:1192): GLib-CRITICAL **: g_source_remove: assertion `tag >
0' failed
bluetoothd[1192]: src/device.c:btd_device_unref() Freeing device
/org/bluez/hci0/dev_12_34_12_34_12_34
bluetoothd[1192]: src/device.c:device_free() 0x463a2a0
src/device.c