core: add autoptr cleanup methods to all internal types

This commit is contained in:
Aleksander Morgado
2020-09-19 20:26:43 +02:00
parent 19ddfa18bb
commit 00949c4ad3
48 changed files with 55 additions and 3 deletions

View File

@@ -45,6 +45,8 @@ struct _MMKernelDeviceGenericClass {
};
GType mm_kernel_device_generic_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMKernelDeviceGeneric, g_object_unref)
MMKernelDevice *mm_kernel_device_generic_new (MMKernelEventProperties *properties,
GError **error);
MMKernelDevice *mm_kernel_device_generic_new_with_rules (MMKernelEventProperties *properties,

View File

@@ -46,6 +46,8 @@ struct _MMKernelDeviceUdevClass {
};
GType mm_kernel_device_udev_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMKernelDeviceUdev, g_object_unref)
MMKernelDevice *mm_kernel_device_udev_new (GUdevDevice *udev_device);
MMKernelDevice *mm_kernel_device_udev_new_from_properties (MMKernelEventProperties *properties,
GError **error);

View File

@@ -72,6 +72,7 @@ struct _MMKernelDeviceClass {
};
GType mm_kernel_device_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMKernelDevice, g_object_unref)
const gchar *mm_kernel_device_get_subsystem (MMKernelDevice *self);
const gchar *mm_kernel_device_get_name (MMKernelDevice *self);

View File

@@ -128,6 +128,7 @@ struct _MMBaseBearerClass {
};
GType mm_base_bearer_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBaseBearer, g_object_unref)
void mm_base_bearer_export (MMBaseBearer *self);

View File

@@ -97,6 +97,7 @@ struct _MMBaseCallClass {
};
GType mm_base_call_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBaseCall, g_object_unref)
/* This one can be overriden by plugins */
MMBaseCall *mm_base_call_new (MMBaseModem *modem,

View File

@@ -50,6 +50,7 @@ typedef struct {
} MMBaseManagerClass;
GType mm_base_manager_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBaseManager, g_object_unref)
MMBaseManager *mm_base_manager_new (GDBusConnection *bus,
const gchar *plugin_dir,

View File

@@ -104,6 +104,7 @@ struct _MMBaseModemClass {
};
GType mm_base_modem_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBaseModem, g_object_unref)
guint mm_base_modem_get_dbus_id (MMBaseModem *self);

View File

@@ -145,6 +145,7 @@ struct _MMBaseSimClass {
};
GType mm_base_sim_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBaseSim, g_object_unref)
void mm_base_sim_new (MMBaseModem *modem,
GCancellable *cancellable,

View File

@@ -80,6 +80,7 @@ struct _MMBaseSmsClass {
};
GType mm_base_sms_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBaseSms, g_object_unref)
/* This one can be overridden by plugins */
MMBaseSms *mm_base_sms_new (MMBaseModem *modem);

View File

@@ -48,6 +48,7 @@ struct _MMBearerListClass {
};
GType mm_bearer_list_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBearerList, g_object_unref)
MMBearerList *mm_bearer_list_new (guint max_bearers,
guint max_active_bearers);

View File

@@ -48,6 +48,7 @@ struct _MMBearerMbimClass {
};
GType mm_bearer_mbim_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBearerMbim, g_object_unref)
/* MBIM bearer creation implementation.
* NOTE it is *not* a broadband bearer, so not async-initable */

View File

@@ -48,6 +48,7 @@ struct _MMBearerQmiClass {
};
GType mm_bearer_qmi_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBearerQmi, g_object_unref)
/* QMI bearer creation implementation.
* NOTE it is *not* a broadband bearer, so not async-initable */

View File

@@ -141,6 +141,7 @@ struct _MMBroadbandBearerClass {
};
GType mm_broadband_bearer_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBroadbandBearer, g_object_unref)
/* Default 3GPP bearer creation implementation */
void mm_broadband_bearer_new (MMBroadbandModem *modem,

View File

@@ -39,6 +39,7 @@ struct _MMBroadbandModemMbimClass{
};
GType mm_broadband_modem_mbim_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBroadbandModemMbim, g_object_unref)
MMBroadbandModemMbim *mm_broadband_modem_mbim_new (const gchar *device,
const gchar **drivers,

View File

@@ -39,6 +39,7 @@ struct _MMBroadbandModemQmiClass{
};
GType mm_broadband_modem_qmi_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBroadbandModemQmi, g_object_unref)
MMBroadbandModemQmi *mm_broadband_modem_qmi_new (const gchar *device,
const gchar **drivers,

View File

@@ -92,6 +92,7 @@ struct _MMBroadbandModemClass {
};
GType mm_broadband_modem_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBroadbandModem, g_object_unref)
MMBroadbandModem *mm_broadband_modem_new (const gchar *device,
const gchar **drivers,

View File

@@ -55,6 +55,7 @@ struct _MMCallListClass {
};
GType mm_call_list_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCallList, g_object_unref)
MMCallList *mm_call_list_new (MMBaseModem *modem);

View File

@@ -60,6 +60,7 @@ struct _MMDeviceClass {
};
GType mm_device_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMDevice, g_object_unref)
MMDevice *mm_device_new (const gchar *uid,
gboolean hotplugged,

View File

@@ -43,6 +43,7 @@ typedef struct {
} MMFilterClass;
GType mm_filter_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMFilter, g_object_unref)
typedef enum { /*< underscore_name=mm_filter_rule >*/
MM_FILTER_RULE_NONE = 0,

View File

@@ -107,6 +107,7 @@ struct _MMIfaceModem3gppUssd {
};
GType mm_iface_modem_3gpp_ussd_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMIfaceModem3gppUssd, g_object_unref)
/* Initialize USSD interface (async) */
void mm_iface_modem_3gpp_ussd_initialize (MMIfaceModem3gppUssd *self,

View File

@@ -237,6 +237,7 @@ struct _MMIfaceModem3gpp {
};
GType mm_iface_modem_3gpp_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMIfaceModem3gpp, g_object_unref)
/* Initialize Modem 3GPP interface (async) */
void mm_iface_modem_3gpp_initialize (MMIfaceModem3gpp *self,

View File

@@ -229,6 +229,7 @@ struct _MMIfaceModemCdma {
};
GType mm_iface_modem_cdma_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMIfaceModemCdma, g_object_unref)
/* Initialize CDMA interface (async) */
void mm_iface_modem_cdma_initialize (MMIfaceModemCdma *self,

View File

@@ -69,6 +69,7 @@ struct _MMIfaceModemFirmware {
};
GType mm_iface_modem_firmware_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMIfaceModemFirmware, g_object_unref)
/* Initialize Firmware interface (async) */
void mm_iface_modem_firmware_initialize (MMIfaceModemFirmware *self,

View File

@@ -106,6 +106,7 @@ struct _MMIfaceModemLocation {
};
GType mm_iface_modem_location_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMIfaceModemLocation, g_object_unref)
/* Initialize Location interface (async) */
void mm_iface_modem_location_initialize (MMIfaceModemLocation *self,

View File

@@ -134,6 +134,7 @@ struct _MMIfaceModemMessaging {
};
GType mm_iface_modem_messaging_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMIfaceModemMessaging, g_object_unref)
/* Initialize Messaging interface (async) */
void mm_iface_modem_messaging_initialize (MMIfaceModemMessaging *self,

View File

@@ -120,6 +120,7 @@ struct _MMIfaceModemOma {
};
GType mm_iface_modem_oma_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMIfaceModemOma, g_object_unref)
/* Initialize Oma interface (async) */
void mm_iface_modem_oma_initialize (MMIfaceModemOma *self,

View File

@@ -59,6 +59,7 @@ struct _MMIfaceModemSignal {
};
GType mm_iface_modem_signal_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMIfaceModemSignal, g_object_unref)
/* Initialize Signal interface (async) */
void mm_iface_modem_signal_initialize (MMIfaceModemSignal *self,

View File

@@ -34,6 +34,7 @@ struct _MMIfaceModemSimple {
};
GType mm_iface_modem_simple_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMIfaceModemSimple, g_object_unref)
/* Initialize Modem Simple interface */
void mm_iface_modem_simple_initialize (MMIfaceModemSimple *self);

View File

@@ -94,6 +94,7 @@ struct _MMIfaceModemTime {
};
GType mm_iface_modem_time_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMIfaceModemTime, g_object_unref)
/* Initialize Time interface (async) */
void mm_iface_modem_time_initialize (MMIfaceModemTime *self,

View File

@@ -196,6 +196,7 @@ struct _MMIfaceModemVoice {
};
GType mm_iface_modem_voice_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMIfaceModemVoice, g_object_unref)
/* Initialize Voice interface (async) */
void mm_iface_modem_voice_initialize (MMIfaceModemVoice *self,

View File

@@ -403,6 +403,7 @@ struct _MMIfaceModem {
};
GType mm_iface_modem_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMIfaceModem, g_object_unref)
/* Helpers to query access technologies */
MMModemAccessTechnology mm_iface_modem_get_access_technologies (MMIfaceModem *self);

View File

@@ -49,6 +49,8 @@ struct _MMPluginManagerClass {
};
GType mm_plugin_manager_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMPluginManager, g_object_unref)
MMPluginManager *mm_plugin_manager_new (const gchar *plugindir,
MMFilter *filter,
GError **error);

View File

@@ -123,6 +123,7 @@ struct _MMPluginClass {
};
GType mm_plugin_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMPlugin, g_object_unref)
const gchar *mm_plugin_get_name (MMPlugin *self);
const gchar **mm_plugin_get_allowed_udev_tags (MMPlugin *self);

View File

@@ -51,6 +51,7 @@ struct _MMPortMbimClass {
};
GType mm_port_mbim_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMPortMbim, g_object_unref)
MMPortMbim *mm_port_mbim_new (const gchar *name);

View File

@@ -79,6 +79,7 @@ typedef gboolean (* MMPortProbeAtCustomInitFinish) (MMPortProbe *probe,
GError **error);
GType mm_port_probe_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMPortProbe, g_object_unref)
MMPortProbe *mm_port_probe_new (MMDevice *device,
MMKernelDevice *port);

View File

@@ -45,6 +45,7 @@ struct _MMPortQmiClass {
};
GType mm_port_qmi_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMPortQmi, g_object_unref)
MMPortQmi *mm_port_qmi_new (const gchar *name);

View File

@@ -77,6 +77,7 @@ struct _MMPortSerialAtClass {
};
GType mm_port_serial_at_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMPortSerialAt, g_object_unref)
MMPortSerialAt *mm_port_serial_at_new (const char *name,
MMPortSubsys subsys);

View File

@@ -46,6 +46,7 @@ struct _MMPortSerialGpsClass {
};
GType mm_port_serial_gps_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMPortSerialGps, g_object_unref)
MMPortSerialGps *mm_port_serial_gps_new (const char *name);

View File

@@ -43,6 +43,7 @@ struct _MMPortSerialQcdmClass {
};
GType mm_port_serial_qcdm_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMPortSerialQcdm, g_object_unref)
MMPortSerialQcdm *mm_port_serial_qcdm_new (const char *name);
MMPortSerialQcdm *mm_port_serial_qcdm_new_fd (int fd);

View File

@@ -107,6 +107,7 @@ struct _MMPortSerialClass {
};
GType mm_port_serial_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMPortSerial, g_object_unref)
MMPortSerial *mm_port_serial_new (const char *name, MMPortType ptype);

View File

@@ -72,6 +72,7 @@ struct _MMPortClass {
};
GType mm_port_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMPort, g_object_unref)
const gchar *mm_port_get_device (MMPort *self);
MMPortSubsys mm_port_get_subsys (MMPort *self);

View File

@@ -49,6 +49,7 @@ struct _MMSharedQmi {
};
GType mm_shared_qmi_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMSharedQmi, g_object_unref)
QmiClient *mm_shared_qmi_peek_client (MMSharedQmi *self,
QmiService service,

View File

@@ -40,6 +40,7 @@ struct _MMSimMbimClass {
};
GType mm_sim_mbim_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMSimMbim, g_object_unref)
void mm_sim_mbim_new (MMBaseModem *modem,
GCancellable *cancellable,

View File

@@ -44,6 +44,7 @@ struct _MMSimQmiClass {
};
GType mm_sim_qmi_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMSimQmi, g_object_unref)
void mm_sim_qmi_new (MMBaseModem *modem,
gboolean dms_uim_deprecated,

View File

@@ -55,6 +55,7 @@ struct _MMSmsListClass {
};
GType mm_sms_list_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMSmsList, g_object_unref)
MMSmsList *mm_sms_list_new (MMBaseModem *modem);

View File

@@ -43,6 +43,7 @@ struct _MMSmsMbimClass {
};
GType mm_sms_mbim_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMSmsMbim, g_object_unref)
MMBaseSms *mm_sms_mbim_new (MMBaseModem *modem);

View File

@@ -59,6 +59,8 @@ MMSmsPart *mm_sms_part_new (guint index,
MMSmsPduType type);
void mm_sms_part_free (MMSmsPart *part);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMSmsPart, mm_sms_part_free)
guint mm_sms_part_get_index (MMSmsPart *part);
void mm_sms_part_set_index (MMSmsPart *part,
guint index);

View File

@@ -45,6 +45,7 @@ struct _MMSmsQmiClass {
};
GType mm_sms_qmi_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMSmsQmi, g_object_unref)
MMBaseSms *mm_sms_qmi_new (MMBaseModem *modem);