Commit bbdcaaa0 authored by Rui Matos's avatar Rui Matos Committed by Bastien Nocera
Browse files

region: Avoid a crash on panel destruction

GtkListBox might emit the row-selected signal while being destroyed
and our row-selected handler accesses widgets owned by GtkBuilder so,
depending on the order on which the builder destroys its objects, we
could crash on the signal handler when destroying the builder.

Using g_signal_connect_object() avoids this issue by disconnecting us
before our finalize() runs.

https://bugzilla.gnome.org/show_bug.cgi?id=770563
parent 2a6706fe
......@@ -1482,8 +1482,8 @@ setup_input_section (CcRegionPanel *self)
gtk_list_box_set_header_func (GTK_LIST_BOX (priv->input_list),
cc_list_box_update_header_func,
NULL, NULL);
g_signal_connect_swapped (priv->input_list, "row-selected",
G_CALLBACK (update_buttons), self);
g_signal_connect_object (priv->input_list, "row-selected",
G_CALLBACK (update_buttons), self, G_CONNECT_SWAPPED);
g_signal_connect (priv->input_settings, "changed::" KEY_INPUT_SOURCES,
G_CALLBACK (input_sources_changed), self);
......
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