Eo: Added a phantom ref if we manual free.

This lets us use eo_do and the such on deleted to be manually freed objects.

SVN revision: 71746
This commit is contained in:
Tom Hacohen 2012-06-06 11:41:53 +00:00
parent 1754ca9608
commit 7c7a6dd1fa
1 changed files with 5 additions and 2 deletions

View File

@ -1291,7 +1291,10 @@ _eo_unref(Eo *obj)
}
#endif
if (!obj->manual_free) _eo_free(obj);
if (!obj->manual_free)
_eo_free(obj);
else
_eo_ref(obj); /* If we manual free, we keep a phantom ref. */
}
}
@ -1580,7 +1583,7 @@ eo_manual_free(Eo *obj)
return;
}
if (0 != obj->refcount)
if (!obj->del)
{
ERR("Tried deleting the object %p while still referenced(%d).", obj, eo_ref_get(obj));
return;