network: Fix a crash when clicking to forget a VPN on the editor

We need to keep a reference to the NetVpn instance or it might already
be finalized when the editor window closes.
This commit is contained in:
Rui Matos 2016-01-26 16:30:54 +01:00
parent d57be89340
commit 2e7b23aa00

View file

@ -406,6 +406,7 @@ editor_done (NetConnectionEditor *editor,
{
g_object_unref (editor);
net_object_refresh (NET_OBJECT (vpn));
g_object_unref (vpn);
}
static void
@ -432,7 +433,7 @@ vpn_proxy_edit (NetObject *object)
net_connection_editor_set_title (editor, title);
g_free (title);
g_signal_connect (editor, "done", G_CALLBACK (editor_done), vpn);
g_signal_connect (editor, "done", G_CALLBACK (editor_done), g_object_ref (vpn));
net_connection_editor_run (editor);
}