[gtkmm] Actionable: Ensure virtual functions don't return freed memory.



commit 3d10dab0a3d17d7fc0e2ca7d520c2bc39f2033e9
Author: Josà Alburquerque <jaalburqu svn gnome org>
Date:   Sun Mar 25 17:16:46 2012 -0400

    Actionable: Ensure virtual functions don't return freed memory.
    
    	* gtk/src/actionable.hg (get_action_name_vfunc_callback): Ensure that
    	the return value of the virtual function of this callback is properly
    	copied by correcting the appropriate conversion so that the callback
    	does not return empty memory.

 ChangeLog             |    9 +++++++++
 gtk/src/actionable.hg |    2 +-
 2 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 75243b8..fc4236a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-03-25  Josà Alburquerque  <jaalburquerque gmail com>
+
+	Actionable: Ensure virtual functions don't return freed memory.
+
+	* gtk/src/actionable.hg (get_action_name_vfunc_callback): Ensure that
+	the return value of the virtual function of this callback is properly
+	copied by correcting the appropriate conversion so that the callback
+	does not return empty memory.
+
 2012-03-23  Murray Cumming  <murrayc murrayc com>
 
 	Gtk::Entry: Deprecate the activate signal.
diff --git a/gtk/src/actionable.hg b/gtk/src/actionable.hg
index 152cbc7..9f88f04 100644
--- a/gtk/src/actionable.hg
+++ b/gtk/src/actionable.hg
@@ -68,7 +68,7 @@ public:
   _WRAP_PROPERTY("action-name", Glib::ustring)
   _WRAP_PROPERTY("action-target", Glib::VariantBase)
 
-#m4 _CONVERSION(`Glib::ustring',`const gchar*',`$3.c_str()')
+#m4 _CONVERSION(`Glib::ustring',`const gchar*',`g_strdup($3.c_str())')
   _WRAP_VFUNC(Glib::ustring get_action_name() const, "get_action_name")
 
   _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]