diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-10-13 14:29:15 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-10-13 18:41:54 +0000 |
commit | bb51869d5fd339703767e1e70c832a803dd981eb (patch) | |
tree | 7d3badde57a69b6cc3fc917517e439651e23b0ac | |
parent | 48864458c08e832408000c60ef521f7c8d8ad689 (diff) |
Resolves: tdf#102999 get_selected_printer is transfer none
gtk_print_unix_dialog_get_settings returns a new GObject we
have to unref, but gtk_print_unix_dialog_get_selected_printer doesn't
add a ref so dies along with its parent dialog.
Change-Id: Ie5f8ecd83f5cc2c13e4a8c3ba292ffa381f9bdf5
(cherry picked from commit c12e14d19f86be8555f6262d138cf0776f2c9b56)
Reviewed-on: https://gerrit.libreoffice.org/29773
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r-- | vcl/unx/gtk/gtkprintwrapper.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/vcl/unx/gtk/gtkprintwrapper.cxx b/vcl/unx/gtk/gtkprintwrapper.cxx index cae1658edc44..248ccf1cbb3c 100644 --- a/vcl/unx/gtk/gtkprintwrapper.cxx +++ b/vcl/unx/gtk/gtkprintwrapper.cxx @@ -276,13 +276,16 @@ void GtkPrintWrapper::print_unix_dialog_add_custom_tab(GtkPrintUnixDialog* dialo GtkPrinter* GtkPrintWrapper::print_unix_dialog_get_selected_printer(GtkPrintUnixDialog* dialog) const { + GtkPrinter* pRet = nullptr; #if !GTK_CHECK_VERSION(3,0,0) assert(m_print_unix_dialog_get_selected_printer); - return (*m_print_unix_dialog_get_selected_printer)(dialog); + pRet = (*m_print_unix_dialog_get_selected_printer)(dialog); #else (void) this; // loplugin:staticmethods - return gtk_print_unix_dialog_get_selected_printer(dialog); + pRet = gtk_print_unix_dialog_get_selected_printer(dialog); #endif + g_object_ref(G_OBJECT(pRet)); + return pRet; } void GtkPrintWrapper::print_unix_dialog_set_manual_capabilities(GtkPrintUnixDialog* dialog, GtkPrintCapabilities capabilities) const |