jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9d14b4cfe8e7c073952067cd2258b9e09fea4f93

commit 9d14b4cfe8e7c073952067cd2258b9e09fea4f93
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Tue Nov 28 14:37:33 2017 +0900

    cxx: Give ref to returned objects
    
    This should give a ref to obj in the following scenario:
    
      auto obj = other.function();
    
    Where obj is an eo object.
---
 src/bindings/cxx/eo_cxx/eo_cxx_interop.hh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh 
b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh
index 9181c11875..ffc486e1e3 100644
--- a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh
+++ b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh
@@ -646,13 +646,13 @@ T& convert_to_return(T* value, tag<T*, T&>)
 template <typename T>
 T convert_to_return(Eo* value, tag<Eo*, T>, typename std::enable_if< 
eo::is_eolian_object<T>::value>::type* = 0)
 {
-  T v{value};
+  T v{eo::detail::ref(value)};
   return v;
 }
 template <typename T>
 T convert_to_return(Eo const* value, tag<Eo const*, T>, typename 
std::enable_if<eo::is_eolian_object<T>::value>::type* = 0)
 {
-  return T{const_cast<Eo*>(value)};
+  return T{const_cast<Eo*>(eo::detail::ref(value))};
 }
 template <typename T>
 eina::list<T> convert_to_return(Eina_List* value, tag<Eina_List*, 
eina::list<T>>)

-- 


Reply via email to