Hi Denis,
On Thu, Apr 19, 2012 at 2:55 AM, Denis Kenzior <denkenz(a)gmail.com> wrote:
Hi Mikel,
>> The patch looks absolutely fine, however can you check whether removing
>> g_hashtable_remove from hfp_remove would do the trick as well? We don't
>> seem to be doing this in the sap driver, and I no longer recall whether
>> this was done in hfp_hf to keep valgrind happy or is simply a mistake.
>
> I was reluctant to make such a change because I wasn't entirely sure about
> which assumptions are made by the core about modem removals.
>
> If we know that all calls to ofono_modem_remove() will be originated in
> hfp_hf.c, then your proposal would just work. I will send the corresponding
> patch soon.
The core does not call ofono_modem_remove on its own, this is triggered
by the plugins (e.g. udev, bluetooth). So Under normal circumstances
all calls to ofono_modem_remove would be triggered by BlueZ reporting
something, e.g. adapter removed, device removed, etc.
In that case the second version that I proposed should work.
The only time this might be a problem is during shutdown, hence my
comment about keeping valgrind happy.
During shutdown the table is freed inside hfp_exit, so that shouldn't
be a problem.
Cheers,
Mikel