From df1c03b56be63e90a12a232bc2a7d06d5d142215 Mon Sep 17 00:00:00 2001 From: Felipe Magno de Almeida Date: Thu, 17 Jul 2014 15:29:31 -0300 Subject: [PATCH] eo-cxx: Added default-constructor to wref type --- src/bindings/eo_cxx/eo_wref.hh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/bindings/eo_cxx/eo_wref.hh b/src/bindings/eo_cxx/eo_wref.hh index 4e2385f2d3..ec3b619da7 100644 --- a/src/bindings/eo_cxx/eo_wref.hh +++ b/src/bindings/eo_cxx/eo_wref.hh @@ -18,8 +18,16 @@ namespace efl { namespace eo { /// @brief Weak references to an EO Object. /// template -struct wref { - +struct wref +{ + /// @brief Default constructor. + /// + /// Create a empty weak reference. + /// + wref() : _eo_wref(nullptr) + { + } + /// @brief Class constructor. /// /// @param obj The EO Object to be referenced. @@ -46,8 +54,9 @@ struct wref { /// ~wref() { - if(eina::optional p = lock()) - _del(); + if(_eo_wref) + if(eina::optional p = lock()) + _del(); } /// @brief Try to acquire a strong reference to the underlying