[glibmm] Gio::Action etc: Add keep_return to some _WRAP_VFUNC()



commit 010a2d71e4379a12849d2cda742dfdc0a868d043
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Tue Mar 17 10:23:37 2015 +0100

    Gio::Action etc: Add keep_return to some _WRAP_VFUNC()
    
    * gio/src/action.hg: Add keep_return to get_name_vfunc(),
    get_parameter_type_vfunc() and get_state_type_vfunc().
    * gio/src/actiongroup.hg: Add keep_return to get_action_parameter_type_vfunc()
    and get_action_state_type_vfunc().
    * gio/src/dbusobject.hg: Add keep_return to get_object_path_vfunc().
    * gio/src/tlspassword.hg: Add keep_return to get_default_warning_vfunc().
    The C code that calls these functions does not get its own copy of the
    returned object. The called function must store a copy. Bug #705124.

 gio/src/action.hg      |   12 +++++-------
 gio/src/actiongroup.hg |    8 +++-----
 gio/src/dbusobject.hg  |    4 ++--
 gio/src/tlspassword.hg |    4 ++--
 4 files changed, 12 insertions(+), 16 deletions(-)
---
diff --git a/gio/src/action.hg b/gio/src/action.hg
index 5e6dcf8..207bb93 100644
--- a/gio/src/action.hg
+++ b/gio/src/action.hg
@@ -1,5 +1,3 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
 /* Copyright (C) 2011 The giomm Development Team
  *
  * This library is free software; you can redistribute it and/or
@@ -216,13 +214,13 @@ public:
   _WRAP_PROPERTY("state", Glib::VariantBase)
   _WRAP_PROPERTY("state-type", Glib::VariantType)
 
-#m4 _CONVERSION(`Glib::ustring',`const gchar*',`g_strdup($3.c_str())')
-  _WRAP_VFUNC(Glib::ustring get_name() const, "get_name")
+#m4 _CONVERSION(`Glib::ustring',`const gchar*',`$3.c_str()')
+  _WRAP_VFUNC(Glib::ustring get_name() const, "get_name", keep_return)
 
-#m4 _CONVERSION(`Glib::VariantType',`const GVariantType*',`$3.gobj_copy()')
+#m4 _CONVERSION(`Glib::VariantType',`const GVariantType*',`$3.gobj()')
 
-  _WRAP_VFUNC(Glib::VariantType get_parameter_type() const, "get_parameter_type")
-  _WRAP_VFUNC(Glib::VariantType get_state_type() const, "get_state_type")
+  _WRAP_VFUNC(Glib::VariantType get_parameter_type() const, "get_parameter_type", keep_return)
+  _WRAP_VFUNC(Glib::VariantType get_state_type() const, "get_state_type", keep_return)
 
 #m4 _CONVERSION(`Glib::VariantBase',`GVariant*',`$3.gobj_copy()')
 
diff --git a/gio/src/actiongroup.hg b/gio/src/actiongroup.hg
index 54411cf..a7483ba 100644
--- a/gio/src/actiongroup.hg
+++ b/gio/src/actiongroup.hg
@@ -1,5 +1,3 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
 /* Copyright (C) 2010 The giomm Development Team
  *
  * This library is free software; you can redistribute it and/or
@@ -150,9 +148,9 @@ public:
 
   _WRAP_VFUNC(bool get_action_enabled(const Glib::ustring& name) const, "get_action_enabled")
 
-#m4 _CONVERSION(`Glib::VariantType',`const GVariantType*',`$3.gobj_copy()')
-  _WRAP_VFUNC(Glib::VariantType get_action_parameter_type(const Glib::ustring& name) const, 
"get_action_parameter_type")
-  _WRAP_VFUNC(Glib::VariantType get_action_state_type(const Glib::ustring& name) const, 
"get_action_state_type")
+#m4 _CONVERSION(`Glib::VariantType',`const GVariantType*',`$3.gobj()')
+  _WRAP_VFUNC(Glib::VariantType get_action_parameter_type(const Glib::ustring& name) const, 
"get_action_parameter_type", keep_return)
+  _WRAP_VFUNC(Glib::VariantType get_action_state_type(const Glib::ustring& name) const, 
"get_action_state_type", keep_return)
 
 #m4 _CONVERSION(`Glib::VariantBase',`GVariant*',`$3.gobj_copy()')
   _WRAP_VFUNC(Glib::VariantBase get_action_state_hint(const Glib::ustring& name) const, 
"get_action_state_hint")
diff --git a/gio/src/dbusobject.hg b/gio/src/dbusobject.hg
index 5431004..6979d82 100644
--- a/gio/src/dbusobject.hg
+++ b/gio/src/dbusobject.hg
@@ -66,8 +66,8 @@ public:
   _WRAP_SIGNAL(void interface_added(const Glib::RefPtr<Gio::DBus::Interface>& iface), "interface_added")
   _WRAP_SIGNAL(void interface_removed(const Glib::RefPtr<Gio::DBus::Interface>& iface), "interface_removed")
 
-#m4 _CONVERSION(`Glib::ustring',`const gchar*',`g_strdup($3.c_str())')
-  _WRAP_VFUNC(Glib::ustring get_object_path() const, "get_object_path")
+#m4 _CONVERSION(`Glib::ustring',`const gchar*',`$3.c_str()')
+  _WRAP_VFUNC(Glib::ustring get_object_path() const, "get_object_path", keep_return)
 
 #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")
diff --git a/gio/src/tlspassword.hg b/gio/src/tlspassword.hg
index 9dbd8f8..841d11a 100644
--- a/gio/src/tlspassword.hg
+++ b/gio/src/tlspassword.hg
@@ -66,8 +66,8 @@ public:
 
   //TODO? (See g_tls_password_set_value_full() comment above): _WRAP_VFUNC(void set_value(guchar* value, 
gssize length, GDestroyNotify destroy), "set_value")
 
-#m4 _CONVERSION(`Glib::ustring', `const gchar*', `g_strdup($3.c_str())')
-  _WRAP_VFUNC(Glib::ustring get_default_warning() const, "get_default_warning")
+#m4 _CONVERSION(`Glib::ustring', `const gchar*', `$3.c_str()')
+  _WRAP_VFUNC(Glib::ustring get_default_warning() const, "get_default_warning", keep_return)
 };
 
 } // namespace Gio


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