eo-cxx: Added default-constructor to wref type

This commit is contained in:
Felipe Magno de Almeida 2014-07-17 15:29:31 -03:00
parent e256a92eb1
commit df1c03b56b
1 changed files with 13 additions and 4 deletions

View File

@ -18,7 +18,15 @@ namespace efl { namespace eo {
/// @brief Weak references to an <em>EO Object</em>.
///
template<typename T>
struct wref {
struct wref
{
/// @brief Default constructor.
///
/// Create a empty weak reference.
///
wref() : _eo_wref(nullptr)
{
}
/// @brief Class constructor.
///
@ -46,6 +54,7 @@ struct wref {
///
~wref()
{
if(_eo_wref)
if(eina::optional<T> p = lock())
_del();
}