Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
dialog: Avoid possible use-after-free
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hadess committed Mar 17, 2014
1 parent 5b4a942 commit 20c764f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gtk/gtkdialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 20c764f

Please sign in to comment.