diff options
Diffstat (limited to 'src/eom-window.c')
-rw-r--r-- | src/eom-window.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/eom-window.c b/src/eom-window.c index cb15773..43c1312 100644 --- a/src/eom-window.c +++ b/src/eom-window.c @@ -181,6 +181,8 @@ struct _EomWindowPrivate { gboolean save_disabled; gboolean needs_reload_confirmation; + GtkPageSetup *page_setup; + #ifdef HAVE_LCMS cmsHPROFILE *display_profile; #endif @@ -2379,11 +2381,15 @@ eom_window_print (EomWindow *window) eom_debug (DEBUG_PRINTING); print_settings = eom_print_get_print_settings (); - page_setup = eom_print_get_page_setup (); /* Make sure the window stays valid while printing */ g_object_ref (window); + if (window->priv->page_setup !=NULL) + page_setup = g_object_ref (window->priv->page_setup); + else + page_setup = NULL; + print = eom_print_operation_new (window->priv->image, print_settings, page_setup); @@ -2404,11 +2410,16 @@ eom_window_print (EomWindow *window) gtk_widget_show (dialog); g_error_free (error); } else if (res == GTK_PRINT_OPERATION_RESULT_APPLY) { + GtkPageSetup *new_page_setup; eom_print_set_print_settings (gtk_print_operation_get_print_settings (print)); - eom_print_set_page_setup (gtk_print_operation_get_default_page_setup (print)); + new_page_setup = gtk_print_operation_get_default_page_setup (print); + if (window->priv->page_setup != NULL) + g_object_unref (window->priv->page_setup); + window->priv->page_setup = g_object_ref (new_page_setup); } - g_object_unref (page_setup); + if (page_setup != NULL) + g_object_unref (page_setup); g_object_unref (print_settings); g_object_unref (window); } @@ -4710,6 +4721,8 @@ eom_window_init (EomWindow *window) window->priv->collection_resizable = FALSE; window->priv->save_disabled = FALSE; + + window->priv->page_setup = NULL; } static void @@ -4726,6 +4739,11 @@ eom_window_dispose (GObject *object) window = EOM_WINDOW (object); priv = window->priv; + if (priv->page_setup != NULL) { + g_object_unref (priv->page_setup); + priv->page_setup = NULL; + } + eom_plugin_engine_garbage_collect (); if (priv->store != NULL) { |