diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2014-03-06 14:58:02 +0200 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2014-03-06 17:14:48 +0200 |
commit | 05cb6b8d3fbd30fa81f7f3500297a84165594642 (patch) | |
tree | 34ec7e96e40ebb2d8f403096b8256a25c1d8cc90 /android/avrcp.c | |
parent | faeb9f0bb87b9db45cebb6728a81fcde7a8fd17b (diff) | |
download | bluez-05cb6b8d3fbd30fa81f7f3500297a84165594642.tar.gz |
android/avrcp: Fix warnings when freeing avrcp_device struct
If the device does not yet have queue due to not have a session it cause
the following warnings when avrcp_device_free is called:
(bluetoothd:1102): GLib-CRITICAL **: g_queue_foreach: assertion 'queue != NULL' failed
(bluetoothd:1102): GLib-CRITICAL **: g_queue_free: assertion 'queue != NULL' failed
Diffstat (limited to 'android/avrcp.c')
-rw-r--r-- | android/avrcp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/android/avrcp.c b/android/avrcp.c index 911b1dfba..1d211adeb 100644 --- a/android/avrcp.c +++ b/android/avrcp.c @@ -442,8 +442,10 @@ static void avrcp_device_free(void *data) { struct avrcp_device *dev = data; - g_queue_foreach(dev->queue, (GFunc) g_free, NULL); - g_queue_free(dev->queue); + if (dev->queue) { + g_queue_foreach(dev->queue, (GFunc) g_free, NULL); + g_queue_free(dev->queue); + } if (dev->session) avrcp_shutdown(dev->session); |