static void
dispose (GObject *object)
{
	NMDhcpListenerPrivate *priv = NM_DHCP_LISTENER_GET_PRIVATE (object);

	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);

	G_OBJECT_CLASS (nm_dhcp_listener_parent_class)->dispose (object);
}
static void
nm_device_macvlan_set_parent (NMDeviceMacvlan *self, NMDevice *parent)
	{
	NMDeviceMacvlanPrivate *priv = NM_DEVICE_MACVLAN_GET_PRIVATE (self);
	NMDevice *device = NM_DEVICE (self);

	if (parent == priv->parent)
		return;

	nm_clear_g_signal_handler (priv->parent, &priv->parent_state_id);

	g_clear_object (&priv->parent);

	if (parent) {
		priv->parent = g_object_ref (parent);
		priv->parent_state_id = g_signal_connect (priv->parent,
		                                          "state-changed",
		                                          G_CALLBACK (parent_state_changed),
		                                          device);

		/* Set parent-dependent unmanaged flag */
		nm_device_set_unmanaged_by_flags (device,
		                                  NM_UNMANAGED_PARENT,
		                                  !nm_device_get_managed (parent, FALSE),
		                                  NM_DEVICE_STATE_REASON_PARENT_MANAGED_CHANGED);
	}

	/* Recheck availability now that the parent has changed */
	nm_device_queue_recheck_available (self,
	                                   NM_DEVICE_STATE_REASON_PARENT_CHANGED,
	                                   NM_DEVICE_STATE_REASON_PARENT_CHANGED);
	g_object_notify (G_OBJECT (device), NM_DEVICE_MACVLAN_PARENT);
}
static void
dispose (GObject *object)
{
	NMConnectionEditor *editor = NM_CONNECTION_EDITOR (object);

	editor->disposed = TRUE;

	if (active_editors && editor->orig_connection)
		g_hash_table_remove (active_editors, editor->orig_connection);

	g_slist_free_full (editor->initializing_pages, g_object_unref);
	editor->initializing_pages = NULL;

	g_slist_free_full (editor->pages, g_object_unref);
	editor->pages = NULL;

	/* Mark any in-progress secrets call as canceled; it will clean up after itself. */
	if (editor->secrets_call)
		editor->secrets_call->canceled = TRUE;

	while (editor->pending_secrets_calls) {
		get_secrets_info_free ((GetSecretsInfo *) editor->pending_secrets_calls->data);
		editor->pending_secrets_calls = g_slist_delete_link (editor->pending_secrets_calls, editor->pending_secrets_calls);
	}

	nm_clear_g_source (&editor->validate_id);

	g_clear_object (&editor->connection);
	g_clear_object (&editor->orig_connection);

	if (editor->window) {
		gtk_widget_destroy (editor->window);
		editor->window = NULL;
	}
	g_clear_object (&editor->parent_window);
	g_clear_object (&editor->builder);

	nm_clear_g_signal_handler (editor->client, &editor->permission_id);
	g_clear_object (&editor->client);

	g_clear_pointer (&editor->last_validation_error, g_free);

	if (editor->inter_page_hash) {
		g_hash_table_destroy (editor->inter_page_hash);
		editor->inter_page_hash = NULL;
	}

	G_OBJECT_CLASS (nm_connection_editor_parent_class)->dispose (object);
}
Example #4
0
static void
_dbus_clear (SettingsPluginIfcfg *self)
{
	SettingsPluginIfcfgPrivate *priv = SETTINGS_PLUGIN_IFCFG_GET_PRIVATE (self);

	nm_clear_g_signal_handler (priv->dbus.connection, &priv->dbus.signal_id);

	nm_clear_g_cancellable (&priv->dbus.cancellable);

	if (priv->dbus.interface) {
		g_dbus_interface_skeleton_unexport (priv->dbus.interface);
		nm_exported_object_skeleton_release (priv->dbus.interface);
		priv->dbus.interface = NULL;
	}

	g_clear_object (&priv->dbus.connection);
}