forked from enlightenment/efl
eo-cxx: Added default-constructor to wref type
This commit is contained in:
parent
e256a92eb1
commit
df1c03b56b
|
@ -18,8 +18,16 @@ namespace efl { namespace eo {
|
||||||
/// @brief Weak references to an <em>EO Object</em>.
|
/// @brief Weak references to an <em>EO Object</em>.
|
||||||
///
|
///
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct wref {
|
struct wref
|
||||||
|
{
|
||||||
|
/// @brief Default constructor.
|
||||||
|
///
|
||||||
|
/// Create a empty weak reference.
|
||||||
|
///
|
||||||
|
wref() : _eo_wref(nullptr)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/// @brief Class constructor.
|
/// @brief Class constructor.
|
||||||
///
|
///
|
||||||
/// @param obj The <em>EO Object</em> to be referenced.
|
/// @param obj The <em>EO Object</em> to be referenced.
|
||||||
|
@ -46,8 +54,9 @@ struct wref {
|
||||||
///
|
///
|
||||||
~wref()
|
~wref()
|
||||||
{
|
{
|
||||||
if(eina::optional<T> p = lock())
|
if(_eo_wref)
|
||||||
_del();
|
if(eina::optional<T> p = lock())
|
||||||
|
_del();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Try to acquire a strong reference to the underlying
|
/// @brief Try to acquire a strong reference to the underlying
|
||||||
|
|
Loading…
Reference in New Issue