[glibmm] ActionGroup, DBusObject: Ensure vfunc callbacks return valid memory.
- From: Josà Alburquerque <jaalburqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] ActionGroup, DBusObject: Ensure vfunc callbacks return valid memory.
- Date: Sun, 25 Mar 2012 21:22:10 +0000 (UTC)
commit 5d11dc98fb5ab8ca1b87205cab335d5703585860
Author: Josà Alburquerque <jaalburqu svn gnome org>
Date: Sun Mar 25 16:56:25 2012 -0400
ActionGroup, DBusObject: Ensure vfunc callbacks return valid memory.
* gio/src/action.hg (get_name_vfunc_callback):
* gio/src/dbusobject.hg (get_object_path_vfunc_callback):
(get_interfaces_vfunc_callback): Ensure that the return values of the
virtual functions of these callbacks are properly copied by correcting
the appropriate conversions so that the callbacks don't return empty
memory.
ChangeLog | 11 +++++++++++
gio/src/action.hg | 3 ++-
gio/src/actiongroup.hg | 1 +
gio/src/dbusobject.hg | 4 ++--
4 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7a611fc..1103814 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2012-03-25 Josà Alburquerque <jaalburquerque gmail com>
+
+ ActionGroup, DBusObject: Ensure vfunc callbacks return valid memory.
+
+ * gio/src/action.hg (get_name_vfunc_callback):
+ * gio/src/dbusobject.hg (get_object_path_vfunc_callback):
+ (get_interfaces_vfunc_callback): Ensure that the return values of the
+ virtual functions of these callbacks are properly copied by correcting
+ the appropriate conversions so that the callbacks don't return empty
+ memory.
+
2012-03-23 Murray Cumming <murrayc murrayc com>
ActionGroup: list_actions_vfunc(): Do not return freed memory.
diff --git a/gio/src/action.hg b/gio/src/action.hg
index 88694f7..baa9b22 100644
--- a/gio/src/action.hg
+++ b/gio/src/action.hg
@@ -90,10 +90,11 @@ public:
_WRAP_PROPERTY("state", Glib::VariantBase)
_WRAP_PROPERTY("state-type", Glib::VariantType)
-#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_name() const, "get_name")
#m4 _CONVERSION(`Glib::VariantType',`const GVariantType*',`$3.gobj_copy()')
+
_WRAP_VFUNC(Glib::VariantType get_parameter_type() const, "get_parameter_type")
_WRAP_VFUNC(Glib::VariantType get_state_type() const, "get_state_type")
diff --git a/gio/src/actiongroup.hg b/gio/src/actiongroup.hg
index 4292caf..195af00 100644
--- a/gio/src/actiongroup.hg
+++ b/gio/src/actiongroup.hg
@@ -85,6 +85,7 @@ public:
_WRAP_SIGNAL(void action_removed(const Glib::ustring& action_name), "action-removed")
#m4 _CONVERSION(`GVariant*', `const Glib::VariantBase&', `Glib::wrap($3, true)')
+
_WRAP_SIGNAL(void action_state_changed(const Glib::ustring& action_name, const Glib::VariantBase& value), "action-state-changed")
_WRAP_VFUNC(bool has_action(const Glib::ustring& name) const, "has_action")
diff --git a/gio/src/dbusobject.hg b/gio/src/dbusobject.hg
index 55390e0..a1e47d6 100644
--- a/gio/src/dbusobject.hg
+++ b/gio/src/dbusobject.hg
@@ -65,10 +65,10 @@ public:
_WRAP_SIGNAL(void interface_added(const Glib::RefPtr<Gio::DBus::Interface>& interface), "interface_added")
_WRAP_SIGNAL(void interface_removed(const Glib::RefPtr<Gio::DBus::Interface>& interface), "interface_removed")
-#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_object_path() const, "get_object_path")
-#m4 _CONVERSION(`std::vector< Glib::RefPtr<Gio::DBus::Interface> >',`GList*',`Glib::ListHandler< Glib::RefPtr<Gio::DBus::Interface> >::vector_to_list($3).data()')
+#m4 _CONVERSION(`std::vector< Glib::RefPtr<Gio::DBus::Interface> >',`GList*',`g_list_copy(Glib::ListHandler< Glib::RefPtr<Gio::DBus::Interface> >::vector_to_list($3).data())')
_WRAP_VFUNC(std::vector< Glib::RefPtr<Gio::DBus::Interface> > get_interfaces() const, "get_interfaces")
_WRAP_VFUNC(Glib::RefPtr<Gio::DBus::Interface> get_interface(const Glib::ustring& interface_name) const, "get_interface")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]