[gtk/matthiasc/for-master] filechooser: Prevent a crash
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master] filechooser: Prevent a crash
- Date: Sat, 12 Sep 2020 14:45:22 +0000 (UTC)
commit 756c52ef08a3c4cc680f44caf93a6b3c2a44bb56
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Sep 12 10:40:13 2020 -0400
filechooser: Prevent a crash
With csd, we are handling external widgets when
there is an entry in the headerbar. Use a weak ref
to prevent that pointer from going stale. This fixes
a crash when cancelling a save dialog.
Fixes: #3110
gtk/gtkfilechooserwidget.c | 1 +
1 file changed, 1 insertion(+)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 12d7a14001..16375eab29 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -2322,6 +2322,7 @@ save_widgets_create (GtkFileChooserWidget *impl)
{
location_entry_disconnect (impl);
impl->location_entry = impl->external_entry;
+ g_object_add_weak_pointer (impl->external_entry, (gpointer *)&impl->location_entry);
location_entry_setup (impl);
g_signal_connect_after (gtk_entry_get_key_controller (GTK_ENTRY (impl->external_entry)),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]