diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-10-13 14:29:15 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-10-13 14:32:50 +0100 |
commit | c12e14d19f86be8555f6262d138cf0776f2c9b56 (patch) | |
tree | 78540108532c2843e23e7618b9db08b276ccc279 /vcl | |
parent | b086fd9923e69b7494fd70e8f62b16c83837f7e6 (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
Diffstat (limited to 'vcl')
-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 |