[gtk/fix-filechooser-portal-crash] filechooserportal: Take a ref on transient-for
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/fix-filechooser-portal-crash] filechooserportal: Take a ref on transient-for
- Date: Thu, 7 Oct 2021 02:40:31 +0000 (UTC)
commit c7d6bf733a4a0790450c959f82262e328cfd4aff
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Oct 6 22:37:45 2021 -0400
filechooserportal: Take a ref on transient-for
This may fix a crash that has been reported in
file_chooser_portal_data_free.
Fixes: #4314
gtk/gtkfilechoosernativeportal.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkfilechoosernativeportal.c b/gtk/gtkfilechoosernativeportal.c
index d65229f6ef..d31337931e 100644
--- a/gtk/gtkfilechoosernativeportal.c
+++ b/gtk/gtkfilechoosernativeportal.c
@@ -79,6 +79,8 @@ filechooser_portal_data_free (FilechooserPortalData *data)
if (data->exported_window)
gtk_window_unexport_handle (data->exported_window);
+ g_clear_object (&data->exported_window);
+
g_free (data->portal_handle);
g_free (data);
@@ -501,7 +503,7 @@ gtk_file_chooser_native_portal_show (GtkFileChooserNative *self,
}
else
{
- data->exported_window = transient_for;
+ data->exported_window = g_object_ref (transient_for);
}
}
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]