X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/0103839d01b8762a836265695cee4efbecc057da..03015247d12176926d1b82db14778ee831ee60df:/lib/base/object.h diff --git a/lib/base/object.h b/lib/base/object.h index d0e2a65e..ea08a771 100644 --- a/lib/base/object.h +++ b/lib/base/object.h @@ -7,9 +7,7 @@ //#define OBJECT_DEBUG -#ifdef OBJECT_DEBUG - #include -#endif +#include typedef int RESULT; @@ -31,9 +29,13 @@ public: volatile int count; oRefCount(): count(0) { } operator volatile int&() { return count; } - ~oRefCount() { + ~oRefCount() + { #ifdef OBJECT_DEBUG - if (count) eDebug("OBJECT_DEBUG FATAL: %p has %d references!", this, count); else eDebug("OBJECT_DEBUG refcount ok! (%p)", this); + if (count) + eDebug("OBJECT_DEBUG FATAL: %p has %d references!", this, count); + else + eDebug("OBJECT_DEBUG refcount ok! (%p)", this); #endif } }; @@ -139,6 +141,7 @@ public: delete this; \ } #else + #warning use non optimized implementation of refcounting. #define DECLARE_REF(x) \ private:oRefCount ref; \ eSingleLock ref_lock; \