Commit b18896f7 authored by Iain Lane's avatar Iain Lane Committed by Beniamino Galvani

{vpn,remote}-connection: disconnect signal handlers when disposed

GNOME Settings 3.26 is crashing every time a VPN connection changed its
state. After some digging, a debug message was put on dispose, and this
issue was found:

libnm-Message: Object 0x55555633c070 disposed
libnm-Message: Object 0x55555633c730 disposed
libnm-Message: Object 0x55555633eae0 disposed
libnm-Message: Object 0x555556340a80 disposed

Thread 1 "gnome-control-c" received signal SIGSEGV, Segmentation fault.
g_type_check_instance_cast (type_instance=type_instance@entry=0x55555633c070, iface_type=93825006537856) at /.../glib/gobject/gtype.c:4057
4057		  node = lookup_type_node_I (type_instance->g_class->g_type);
(gdb) bt

NetworkManager is calling callbacks on disposed objects, which leads to
crashes in clients (e.g. GNOME Settings).

Fix this issue by disconnecting signal handlers when the objects are
disposed.

Patch originally by Georges Basile Stavracas Neto <georges.stavracas@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=787893
parent 91fa2023
......@@ -641,7 +641,7 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error)
GVariant *settings;
priv->proxy = NMDBUS_SETTINGS_CONNECTION (_nm_object_get_proxy (NM_OBJECT (initable), NM_DBUS_INTERFACE_SETTINGS_CONNECTION));
g_signal_connect (priv->proxy, "updated", G_CALLBACK (updated_cb), initable);
g_signal_connect_object (priv->proxy, "updated", G_CALLBACK (updated_cb), initable, 0);
if (nmdbus_settings_connection_call_get_settings_sync (priv->proxy,
&settings,
......@@ -730,8 +730,8 @@ init_async (GAsyncInitable *initable, int io_priority,
priv->proxy = NMDBUS_SETTINGS_CONNECTION (_nm_object_get_proxy (NM_OBJECT (initable),
NM_DBUS_INTERFACE_SETTINGS_CONNECTION));
g_signal_connect (priv->proxy, "updated",
G_CALLBACK (updated_cb), initable);
g_signal_connect_object (priv->proxy, "updated",
G_CALLBACK (updated_cb), initable, 0);
nmdbus_settings_connection_call_get_settings (NM_REMOTE_CONNECTION_GET_PRIVATE (init_data->initable)->proxy,
init_data->cancellable,
......
......@@ -144,8 +144,8 @@ init_dbus (NMObject *object)
property_info);
proxy = _nm_object_get_proxy (object, NM_DBUS_INTERFACE_VPN_CONNECTION);
g_signal_connect (proxy, "vpn-state-changed",
G_CALLBACK (vpn_state_changed_proxy), object);
g_signal_connect_object (proxy, "vpn-state-changed",
G_CALLBACK (vpn_state_changed_proxy), object, 0);
g_object_unref (proxy);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment