Release temporary object representing page setup

See #14233.
This commit is contained in:
Artur Wieczorek
2017-05-29 20:26:45 +02:00
parent fe7854933a
commit ab6bdb94be

View File

@@ -702,7 +702,9 @@ int wxGtkPrintDialog::ShowModal()
// If the settings are OK, we restore it.
if (settings != NULL)
gtk_print_operation_set_print_settings (printOp, settings);
gtk_print_operation_set_default_page_setup (printOp, native->GetPageSetupFromSettings(settings));
GtkPageSetup* pgSetup = native->GetPageSetupFromSettings(settings);
gtk_print_operation_set_default_page_setup (printOp, pgSetup);
g_object_unref(pgSetup);
// Show the dialog if needed.
GError* gError = NULL;
@@ -846,6 +848,8 @@ int wxGtkPageSetupDialog::ShowModal()
gtk_page_setup_unix_dialog_set_page_setup(
GTK_PAGE_SETUP_UNIX_DIALOG(dlg), oldPageSetup);
g_object_unref(oldPageSetup);
int result = gtk_dialog_run(GTK_DIALOG(dlg));
gtk_widget_hide(dlg);