forked from enlightenment/efl
cxx: Add global _delete() method to all objects
This is really just calling efl_del() and detaching the internal pointer from the C++ object. This will not affect other references, which means after del the object may still be alive, probably without a parent.
This commit is contained in:
parent
09cf282741
commit
c9322dd561
|
@ -167,6 +167,13 @@ struct concrete
|
|||
_eo_raw = _ptr;
|
||||
}
|
||||
|
||||
void _delete()
|
||||
{
|
||||
Eo* tmp = _eo_raw;
|
||||
_eo_raw = nullptr;
|
||||
detail::del(tmp);
|
||||
}
|
||||
|
||||
explicit operator bool() const
|
||||
{
|
||||
return _eo_raw;
|
||||
|
|
|
@ -39,6 +39,12 @@ unref(const Eo *obj)
|
|||
::efl_unref(obj);
|
||||
}
|
||||
|
||||
inline void
|
||||
del(Eo *obj)
|
||||
{
|
||||
::efl_del(obj);
|
||||
}
|
||||
|
||||
inline int
|
||||
ref_get(const Eo *obj)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue