forked from enlightenment/efl
Eo: Add an error if we get to a negative refcount.
SVN revision: 75505
This commit is contained in:
parent
8a2c9acb0b
commit
7ac9e7cd4f
|
@ -1272,7 +1272,8 @@ _eo_free(Eo *obj)
|
|||
static inline void
|
||||
_eo_unref(Eo *obj)
|
||||
{
|
||||
if (--(obj->refcount) == 0)
|
||||
--(obj->refcount);
|
||||
if (obj->refcount == 0)
|
||||
{
|
||||
if (obj->del)
|
||||
{
|
||||
|
@ -1298,6 +1299,11 @@ _eo_unref(Eo *obj)
|
|||
else
|
||||
_eo_ref(obj); /* If we manual free, we keep a phantom ref. */
|
||||
}
|
||||
else if (obj->refcount < 0)
|
||||
{
|
||||
ERR("Obj:%p. Refcount (%d) < 0. Too many unrefs.", obj, obj->refcount);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
|
Loading…
Reference in New Issue