From 8a4c99379b6137080eb9cbbc07aa9ffd413c3c5b Mon Sep 17 00:00:00 2001 From: Daemonratte Date: Thu, 15 Oct 2026 17:39:58 +0200 Subject: [PATCH] printunixdialog: release the parent folder after the check Backported from GTK 3 commit 7fbf6a67a2 by Matthias Clasen. --- gtk/gtkprintunixdialog.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c index af64a5a37..0e27a37f9 100644 --- a/gtk/gtkprintunixdialog.c +++ b/gtk/gtkprintunixdialog.c @@ -463,10 +463,14 @@ error_dialogs (GtkPrintUnixDialog *print_dialog, if (file != NULL && g_file_query_exists (file, NULL)) { + GFile *parent; + toplevel = get_toplevel (GTK_WIDGET (print_dialog)); basename = g_file_get_basename (file); - dirname = g_file_get_parse_name (g_file_get_parent (file)); + parent = g_file_get_parent (file); + dirname = g_file_get_parse_name (parent); + g_object_unref (parent); dialog = gtk_message_dialog_new (toplevel, GTK_DIALOG_MODAL |