[gtkmm/gtkmm-3-22] Gtk::PrintJob: Fix a call to Glib::throw_exception()



commit 415aa5456f5626bf1ed02cd8e8c8ad7aee2067a8
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Tue Jul 11 08:59:49 2017 +0200

    Gtk::PrintJob: Fix a call to Glib::throw_exception()
    
    Glib::throw_exception(GError*) takes ownership of the GError.
    SignalProxy_Custom_gtk_callback() must give a copy to throw_exception().

 gtk/src/printjob.ccg |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gtk/src/printjob.ccg b/gtk/src/printjob.ccg
index 8b0820d..bf90c7c 100644
--- a/gtk/src/printjob.ccg
+++ b/gtk/src/printjob.ccg
@@ -25,13 +25,12 @@ static void SignalProxy_Custom_gtk_callback(GtkPrintJob* print_job, gpointer dat
 
   try
   {
+    if (gerror)
+      Glib::Error::throw_exception(g_error_copy(gerror));
 
     // Create a suitable C++ instance to pass to the C++ method;
     auto job = Glib::wrap(print_job);
-
-    if (gerror) Glib::Error::throw_exception(const_cast<GError*>(gerror)); //TODO: Remove the case when this 
is fixed in glibmm.
     (*the_slot)(job);
-
   }
   catch(...)
   {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]