core: use nm_clear_g_signal_handler() where possible
Replacement was done with command: spatch --sp-file nm_clear_g_signal_handler.cocci --in-place --smpl-spacing --dir src where nm_clear_g_signal_handler.cocci contains: @@ expression obj, id; @@ - if (id) { - g_signal_handler_disconnect (obj, id); - id = 0; - } + nm_clear_g_signal_handler (obj, &id);
This commit is contained in:
@@ -1031,10 +1031,7 @@ dcb_carrier_cleanup (NMDevice *device)
|
||||
{
|
||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device);
|
||||
|
||||
if (priv->dcb_carrier_id) {
|
||||
g_signal_handler_disconnect (device, priv->dcb_carrier_id);
|
||||
priv->dcb_carrier_id = 0;
|
||||
}
|
||||
nm_clear_g_signal_handler (device, &priv->dcb_carrier_id);
|
||||
}
|
||||
|
||||
static void dcb_state (NMDevice *device, gboolean timeout);
|
||||
|
@@ -3920,10 +3920,7 @@ dhcp4_cleanup (NMDevice *self, CleanupType cleanup_type, gboolean release)
|
||||
|
||||
if (priv->dhcp4_client) {
|
||||
/* Stop any ongoing DHCP transaction on this device */
|
||||
if (priv->dhcp4_state_sigid) {
|
||||
g_signal_handler_disconnect (priv->dhcp4_client, priv->dhcp4_state_sigid);
|
||||
priv->dhcp4_state_sigid = 0;
|
||||
}
|
||||
nm_clear_g_signal_handler (priv->dhcp4_client, &priv->dhcp4_state_sigid);
|
||||
|
||||
nm_device_remove_pending_action (self, PENDING_ACTION_DHCP4, FALSE);
|
||||
|
||||
@@ -4614,10 +4611,7 @@ dhcp6_cleanup (NMDevice *self, CleanupType cleanup_type, gboolean release)
|
||||
nm_clear_g_source (&priv->dhcp6_restart_id);
|
||||
|
||||
if (priv->dhcp6_client) {
|
||||
if (priv->dhcp6_state_sigid) {
|
||||
g_signal_handler_disconnect (priv->dhcp6_client, priv->dhcp6_state_sigid);
|
||||
priv->dhcp6_state_sigid = 0;
|
||||
}
|
||||
nm_clear_g_signal_handler (priv->dhcp6_client, &priv->dhcp6_state_sigid);
|
||||
|
||||
if ( cleanup_type == CLEANUP_TYPE_DECONFIGURE
|
||||
|| cleanup_type == CLEANUP_TYPE_REMOVED)
|
||||
@@ -5637,15 +5631,8 @@ addrconf6_cleanup (NMDevice *self)
|
||||
{
|
||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
||||
|
||||
if (priv->rdisc_changed_id) {
|
||||
g_signal_handler_disconnect (priv->rdisc, priv->rdisc_changed_id);
|
||||
priv->rdisc_changed_id = 0;
|
||||
}
|
||||
|
||||
if (priv->rdisc_timeout_id) {
|
||||
g_signal_handler_disconnect (priv->rdisc, priv->rdisc_timeout_id);
|
||||
priv->rdisc_timeout_id = 0;
|
||||
}
|
||||
nm_clear_g_signal_handler (priv->rdisc, &priv->rdisc_changed_id);
|
||||
nm_clear_g_signal_handler (priv->rdisc, &priv->rdisc_timeout_id);
|
||||
|
||||
nm_device_remove_pending_action (self, PENDING_ACTION_AUTOCONF6, FALSE);
|
||||
|
||||
@@ -6721,10 +6708,7 @@ dnsmasq_cleanup (NMDevice *self)
|
||||
if (!priv->dnsmasq_manager)
|
||||
return;
|
||||
|
||||
if (priv->dnsmasq_state_id) {
|
||||
g_signal_handler_disconnect (priv->dnsmasq_manager, priv->dnsmasq_state_id);
|
||||
priv->dnsmasq_state_id = 0;
|
||||
}
|
||||
nm_clear_g_signal_handler (priv->dnsmasq_manager, &priv->dnsmasq_state_id);
|
||||
|
||||
nm_dnsmasq_manager_stop (priv->dnsmasq_manager);
|
||||
g_object_unref (priv->dnsmasq_manager);
|
||||
|
@@ -211,14 +211,8 @@ dispose (GObject *object)
|
||||
{
|
||||
NMDhcpListenerPrivate *priv = NM_DHCP_LISTENER_GET_PRIVATE (object);
|
||||
|
||||
if (priv->new_conn_id) {
|
||||
g_signal_handler_disconnect (priv->dbus_mgr, priv->new_conn_id);
|
||||
priv->new_conn_id = 0;
|
||||
}
|
||||
if (priv->dis_conn_id) {
|
||||
g_signal_handler_disconnect (priv->dbus_mgr, priv->dis_conn_id);
|
||||
priv->dis_conn_id = 0;
|
||||
}
|
||||
nm_clear_g_signal_handler (priv->dbus_mgr, &priv->new_conn_id);
|
||||
nm_clear_g_signal_handler (priv->dbus_mgr, &priv->dis_conn_id);
|
||||
priv->dbus_mgr = NULL;
|
||||
|
||||
g_clear_pointer (&priv->signal_handlers, g_hash_table_destroy);
|
||||
|
@@ -277,10 +277,7 @@ path_watch_stop (NMIfcfgConnection *self)
|
||||
|
||||
ih = _get_inotify_helper (priv);
|
||||
|
||||
if (priv->ih_event_id) {
|
||||
g_signal_handler_disconnect (ih, priv->ih_event_id);
|
||||
priv->ih_event_id = 0;
|
||||
}
|
||||
nm_clear_g_signal_handler (ih, &priv->ih_event_id);
|
||||
|
||||
if (priv->file_wd >= 0) {
|
||||
nm_inotify_helper_remove_watch (ih, priv->file_wd);
|
||||
@@ -516,11 +513,7 @@ dispose (GObject *object)
|
||||
|
||||
path_watch_stop (NM_IFCFG_CONNECTION (object));
|
||||
|
||||
if (priv->devtimeout_link_changed_handler) {
|
||||
g_signal_handler_disconnect (nm_platform_get (),
|
||||
priv->devtimeout_link_changed_handler);
|
||||
priv->devtimeout_link_changed_handler = 0;
|
||||
}
|
||||
nm_clear_g_signal_handler (nm_platform_get(), &priv->devtimeout_link_changed_handler);
|
||||
nm_clear_g_source (&priv->devtimeout_timeout_id);
|
||||
|
||||
g_clear_object (&priv->inotify_helper);
|
||||
|
@@ -589,10 +589,7 @@ dispose (GObject *object)
|
||||
SettingsPluginKeyfilePrivate *priv = SETTINGS_PLUGIN_KEYFILE_GET_PRIVATE (object);
|
||||
|
||||
if (priv->monitor) {
|
||||
if (priv->monitor_id) {
|
||||
g_signal_handler_disconnect (priv->monitor, priv->monitor_id);
|
||||
priv->monitor_id = 0;
|
||||
}
|
||||
nm_clear_g_signal_handler (priv->monitor, &priv->monitor_id);
|
||||
|
||||
g_file_monitor_cancel (priv->monitor);
|
||||
g_clear_object (&priv->monitor);
|
||||
|
Reference in New Issue
Block a user