mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-06 02:40:07 +00:00
dialog: Avoid possible use-after-free
When the dialogue's titlebar was replaced, we were still trying to update the label we constructed but that was now destroyed. https://bugzilla.gnome.org/show_bug.cgi?id=726492
This commit is contained in:
parent
5b4a942260
commit
20c764fc5e
@ -304,7 +304,7 @@ apply_use_header_bar (GtkDialog *dialog)
|
||||
label = gtk_label_new ("");
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (label), "title");
|
||||
gtk_box_set_center_widget (GTK_BOX (box), label);
|
||||
g_signal_connect (dialog, "notify::title", G_CALLBACK (update_title), label);
|
||||
g_signal_connect_object (dialog, "notify::title", G_CALLBACK (update_title), label, 0);
|
||||
}
|
||||
|
||||
gtk_window_set_titlebar (GTK_WINDOW (dialog), box);
|
||||
|
Loading…
Reference in New Issue
Block a user