-#define DEFINE_REF(c) void c::AddRef() { ++object_total_remaining; ++ref; eDebug("OBJECT_DEBUG " #c "+%p now %d", this, (int)ref); } void c::Release() { --object_total_remaining; eDebug("OBJECT_DEBUG " #c "-%p now %d", this, ref-1); if (!--ref) delete this; }
+#define DEFINE_REF(c) void c::AddRef() { eSingleLocker l(ref_lock); ++object_total_remaining; ++ref; eDebug("OBJECT_DEBUG " #c "+%p now %d", this, (int)ref); } void c::Release() { { eSingleLocker l(ref_lock); --object_total_remaining; --ref; eDebug("OBJECT_DEBUG " #c "-%p now %d", this, ref); } if (!ref) delete this; }
+#error fix locking for debug