device: add null check on `self->priv->modem' in clear_modem
clear_modem() can be invoked from set_property() and dispose(), where `self->priv->modem' may be NULL. This patch adds a null check on the modem object to make sure we don't run g_object_run_dispose() on a null modem object.
This commit is contained in:

committed by
Aleksander Morgado

parent
f0cda20930
commit
73bfe94643
@@ -302,10 +302,12 @@ clear_modem (MMDevice *self)
|
||||
self->priv->modem_valid_id = 0;
|
||||
}
|
||||
|
||||
if (self->priv->modem) {
|
||||
/* Run dispose before unref-ing, in order to cleanup the SIM object,
|
||||
* if any (which also holds a reference to the modem object) */
|
||||
g_object_run_dispose (G_OBJECT (self->priv->modem));
|
||||
g_clear_object (&(self->priv->modem));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
Reference in New Issue
Block a user