base-manager: don't assume a MMDevice always holds a MMModem
There are cases, e.g. during modem object disposal, where this is not true.
This commit is contained in:
@@ -763,9 +763,13 @@ mm_base_manager_sync (MMBaseManager *self)
|
|||||||
/* Refresh each device */
|
/* Refresh each device */
|
||||||
g_hash_table_iter_init (&iter, self->priv->devices);
|
g_hash_table_iter_init (&iter, self->priv->devices);
|
||||||
while (g_hash_table_iter_next (&iter, &key, &value)) {
|
while (g_hash_table_iter_next (&iter, &key, &value)) {
|
||||||
MMBaseModem *modem = mm_device_peek_modem (MM_DEVICE (value));
|
MMBaseModem *modem;
|
||||||
|
|
||||||
|
modem = mm_device_peek_modem (MM_DEVICE (value));
|
||||||
|
|
||||||
/* We just want to start the synchronization, we don't need the result */
|
/* We just want to start the synchronization, we don't need the result */
|
||||||
mm_base_modem_sync (modem, (GAsyncReadyCallback)mm_base_modem_sync_ready, NULL);
|
if (modem)
|
||||||
|
mm_base_modem_sync (modem, (GAsyncReadyCallback)mm_base_modem_sync_ready, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user