From b523df8aa557f65014f302222da62a910f52bdd2 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Tue, 27 Jan 2015 15:47:34 +0100 Subject: [PATCH] android/handsfree: Fix removing invalid glib source dev->ring is only valid if there is incoming call and AG is sending RING indications. Fix following: external/bluetooth/bluez/android/handsfree.c:disconnect_watch() g_source_remove: assertion `tag > 0' failed --- android/handsfree.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/android/handsfree.c b/android/handsfree.c index 1a530800c..98d40b3ff 100644 --- a/android/handsfree.c +++ b/android/handsfree.c @@ -258,7 +258,9 @@ static void device_destroy(struct hf_device *dev) if (dev->audio_state == HAL_EV_HANDSFREE_AUDIO_STATE_CONNECTED) bt_sco_disconnect(sco); - g_source_remove(dev->ring); + if (dev->ring) + g_source_remove(dev->ring); + g_free(dev->clip); set_audio_state(dev, HAL_EV_HANDSFREE_AUDIO_STATE_DISCONNECTED); -- 2.47.3