felipealmeida pushed a commit to branch master.

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

commit b5c4aeab94b276e001819d22cc684a71caff564a
Author: Felipe Magno de Almeida <fel...@expertisesolutions.com.br>
Date:   Fri Sep 15 15:16:58 2017 -0300

    eo-cxx: Fix possible non-initialization in copy-constructor and 
move-constructor
---
 src/bindings/cxx/eo_cxx/eo_concrete.hh | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/bindings/cxx/eo_cxx/eo_concrete.hh 
b/src/bindings/cxx/eo_cxx/eo_concrete.hh
index f02eb0cba0..e5966a31a5 100644
--- a/src/bindings/cxx/eo_cxx/eo_concrete.hh
+++ b/src/bindings/cxx/eo_cxx/eo_concrete.hh
@@ -72,6 +72,7 @@ struct concrete
    }
 
    concrete(concrete const& other)
+     : _eo_raw(nullptr)
    {
      if(other._eo_raw)
        _eo_raw = detail::ref(other._eo_raw);
@@ -94,17 +95,15 @@ struct concrete
         }
       if(other._eo_raw)
         _eo_raw = detail::ref(other._eo_raw);
+      else
+        _eo_raw = nullptr;
       return *this;
    }
 
    concrete& operator=(concrete&& other)
    {
-      if(_eo_raw)
-        {
-           detail::unref(_eo_raw);
-           _eo_raw = nullptr;
-        }
-      std::swap(_eo_raw, other._eo_raw);
+      concrete tmp(other);
+      std::swap(*this, tmp);
       return *this;
    }
   

-- 


Reply via email to