[gtkmm] Gtk::Actionable: Add keep_return to a _WRAP_VFUNC()



commit ac32be281848584db9ae57841e888740f4c9667d
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Thu Mar 26 16:01:26 2015 +0100

    Gtk::Actionable: Add keep_return to a _WRAP_VFUNC()
    
    * gtk/src/actionable.hg: Add keep_return to get_action_name_vfunc().
    The C code that calls this function does not get its own copy of the
    returned string. The called function must store a copy.
    See the glibmm bug #705124.

 gtk/src/actionable.hg |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/src/actionable.hg b/gtk/src/actionable.hg
index 3bfd7e2..6ec203b 100644
--- a/gtk/src/actionable.hg
+++ b/gtk/src/actionable.hg
@@ -66,8 +66,8 @@ public:
   _WRAP_PROPERTY("action-name", Glib::ustring)
   _WRAP_PROPERTY("action-target", Glib::VariantBase)
 
-#m4 _CONVERSION(`Glib::ustring',`const gchar*',`g_strdup($3.c_str())')
-  _WRAP_VFUNC(Glib::ustring get_action_name() const, "get_action_name")
+#m4 _CONVERSION(`Glib::ustring',`const gchar*',`$3.empty() ? 0 : $3.c_str()')
+  _WRAP_VFUNC(Glib::ustring get_action_name() const, "get_action_name", keep_return)
 
   _WRAP_VFUNC(void set_action_name(const Glib::ustring& action_name), "set_action_name")
 


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