From fe7854933a0e457139b65bf644075c941f1f800a Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 29 May 2017 00:50:36 +0200 Subject: [PATCH] Release old print settings object prior to storing a new one Old GtkPrintSettings object should be released before copying its new instance. See #14233. --- src/gtk/print.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gtk/print.cpp b/src/gtk/print.cpp index 0bc556158e..11fd1ddcc4 100644 --- a/src/gtk/print.cpp +++ b/src/gtk/print.cpp @@ -584,7 +584,13 @@ bool wxGtkPrintNativeData::TransferFrom( const wxPrintData &data ) void wxGtkPrintNativeData::SetPrintConfig( GtkPrintSettings * config ) { if (config) + { + if ( m_config ) + { + g_object_unref(m_config); + } m_config = gtk_print_settings_copy(config); + } } // Extract page setup from settings.