iface-modem-messaging: fix INSTANCE_CAST() vs. GET_INTERFACE() confusion
Yeah, GObject is pretty obscure here. But to get the implementation's override function, we want GET_INTERFACE, otherwise we're looking at some random memory location that's sometimes NULL. And then we crash.
This commit is contained in:
@@ -91,7 +91,7 @@ mm_iface_modem_messaging_bind_simple_status (MMIfaceModemMessaging *self,
|
|||||||
MMSms *
|
MMSms *
|
||||||
mm_iface_modem_messaging_create_sms (MMIfaceModemMessaging *self)
|
mm_iface_modem_messaging_create_sms (MMIfaceModemMessaging *self)
|
||||||
{
|
{
|
||||||
g_assert (MM_IFACE_MODEM_MESSAGING (self)->create_sms != NULL);
|
g_assert (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->create_sms != NULL);
|
||||||
|
|
||||||
return MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->create_sms (self);
|
return MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->create_sms (self);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user