Re: [MM] [PATCH] iface-modem: Fix crash in expire_signal_quality due to removed skeleton.

Hey Ben,

> expire_signal_quality() may be called after the DBus object skeleton is
> removed in mm_iface_modem_shutdown() and before
> signal_quality_update_context_free() is called due to the destruction of
> the modem object. This patch prevents expire_signal_quality() from
> accessing an already removed skeleton.

Ugly race it is :-/ So the data set with g_object_set_qdata_full() gets
actually destroyed *after* dispose() has run, right? Just wondering if
it isn't better to ensure in each interface's _shutdown() method that we
clear any data association we may have set previously, by calling again
g_object_set_qdata() with a NULL pointer. That should call the
GDestroyNotify of each data associated previously, if any, and it will
get the timeouts removed from the main loop as well. That would also
help for the cases where, due to some bug in some other place, we let a
reference to the modem object around, effectively leaving the timeouts
running even after we think everything has been disposed.

What do you think?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]