Don't leak a file descriptor, and don't make the error dialog modal.

2007-04-29  Mattthias Clasen  <mclasen@redhat.com>

        * gtk/gtkprintoperation-unix.c 
        (_gtk_print_operation_platform_backend_launch_preview):
        Don't leak a file descriptor, and don't make the error
        dialog modal.  (#421985, Morten Welinder)



svn path=/trunk/; revision=17708
This commit is contained in:
Mattthias Clasen 2007-04-29 18:03:35 +00:00 committed by Matthias Clasen
parent f4895bec77
commit 99e8b92b6a
2 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2007-04-29 Mattthias Clasen <mclasen@redhat.com>
* gtk/gtkprintoperation-unix.c
(_gtk_print_operation_platform_backend_launch_preview):
Don't leak a file descriptor, and don't make the error
dialog modal. (#421985, Morten Welinder)
2007-04-29 Xan Lopez <xan@gnome.org>
* docs/faq/gtk-faq.sgml: Fix typo in FAQ (#373706,

View File

@ -212,8 +212,6 @@ _gtk_print_operation_platform_backend_launch_preview (GtkPrintOperation *op,
if (!gtk_print_settings_to_file (print_settings, settings_filename, &error))
goto out;
close (fd);
settings = gtk_settings_get_for_screen (screen);
g_object_get (settings, "gtk-print-preview-command", &preview_cmd, NULL);
@ -235,6 +233,8 @@ _gtk_print_operation_platform_backend_launch_preview (GtkPrintOperation *op,
g_strfreev (argv);
out:
close (fd);
if (error != NULL)
{
GtkWidget *edialog;
@ -245,7 +245,6 @@ _gtk_print_operation_platform_backend_launch_preview (GtkPrintOperation *op,
_("Error launching preview") /* FIXME better text */);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (edialog),
"%s", error->message);
gtk_window_set_modal (GTK_WINDOW (edialog), TRUE);
g_signal_connect (edialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);