summaryrefslogtreecommitdiff
path: root/legacy/eobj
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2012-08-21 12:15:54 +0000
committerTom Hacohen <tom@stosb.com>2012-08-21 12:15:54 +0000
commit7ac9e7cd4fd80c9dd655dc85f149a590abdeed4f (patch)
treea85625f43ff8280b1369bf1b0cdad69a7bf25f6d /legacy/eobj
parent8a2c9acb0b0dbfda78ebcbd5f8b4f50fe57c7556 (diff)
Eo: Add an error if we get to a negative refcount.
SVN revision: 75505
Diffstat (limited to 'legacy/eobj')
-rw-r--r--legacy/eobj/src/lib/eo.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/legacy/eobj/src/lib/eo.c b/legacy/eobj/src/lib/eo.c
index 2eae61ab06..12812fb3a7 100644
--- a/legacy/eobj/src/lib/eo.c
+++ b/legacy/eobj/src/lib/eo.c
@@ -1272,7 +1272,8 @@ _eo_free(Eo *obj)
1272static inline void 1272static inline void
1273_eo_unref(Eo *obj) 1273_eo_unref(Eo *obj)
1274{ 1274{
1275 if (--(obj->refcount) == 0) 1275 --(obj->refcount);
1276 if (obj->refcount == 0)
1276 { 1277 {
1277 if (obj->del) 1278 if (obj->del)
1278 { 1279 {
@@ -1298,6 +1299,11 @@ _eo_unref(Eo *obj)
1298 else 1299 else
1299 _eo_ref(obj); /* If we manual free, we keep a phantom ref. */ 1300 _eo_ref(obj); /* If we manual free, we keep a phantom ref. */
1300 } 1301 }
1302 else if (obj->refcount < 0)
1303 {
1304 ERR("Obj:%p. Refcount (%d) < 0. Too many unrefs.", obj, obj->refcount);
1305 return;
1306 }
1301} 1307}
1302 1308
1303EAPI void 1309EAPI void