hfp_hf: Fix modifying hash table while iterating
authorMikel Astiz <mikel.astiz.oss@gmail.com>
Thu, 19 Apr 2012 06:58:58 +0000 (08:58 +0200)
committerDenis Kenzior <denkenz@gmail.com>
Thu, 19 Apr 2012 12:41:27 +0000 (07:41 -0500)
commitc9d3ce5c221306622a23566da7ca683ca258107a
tree5b006add0e98f8f2dc42af2508de7576887e59f8
parentd0232dee065d407b63c6730f3e6d0a56129ccfe2
hfp_hf: Fix modifying hash table while iterating

Calling ofono_remove_modem() while iterating the hash table is not safe
given that it can modify the table in hfp_remove().

A simple way to reproduce the problem is to pair some Bluetooth phones
and remove the Bluetooth adapter, triggering a GLib-CRITICAL assertion.

This patch just removes the update of the hash table inside
hfp_remove(). This can be safe as long as all calls to
ofono_modem_remove() are accompanied by a hash table update. The only
example of this kind right now is hfp_agent_release().
plugins/hfp_hf.c