git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- added iStaticServiceInformation
[enigma2.git]
/
lib
/
base
/
object.h
diff --git
a/lib/base/object.h
b/lib/base/object.h
index ddb4512c2dea94c2b775c015768fbfc23ccccda5..64d9a88f6866cb5d2138901ef20d5a27c768ad1a 100644
(file)
--- a/
lib/base/object.h
+++ b/
lib/base/object.h
@@
-14,6
+14,11
@@
typedef int RESULT;
class iObject
{
class iObject
{
+private:
+ /* we don't allow the default operator here, as it would break the refcount. */
+ void operator=(const iObject &);
+protected:
+ virtual ~iObject() { }
public:
virtual void AddRef()=0;
virtual void Release()=0;
public:
virtual void AddRef()=0;
virtual void Release()=0;
@@
-25,6
+30,11
@@
class oRefCount
public:
oRefCount(): ref(0) { }
operator int&() { return ref; }
public:
oRefCount(): ref(0) { }
operator int&() { return ref; }
+ ~oRefCount() {
+#ifdef OBJECT_DEBUG
+ if (ref) eDebug("OBJECT_DEBUG FATAL: %p has %d references!", this, ref); else eDebug("OBJECT_DEBUG refcount ok! (%p)", this);
+#endif
+ }
};
#define DECLARE_REF private: oRefCount ref; public: void AddRef(); void Release();
};
#define DECLARE_REF private: oRefCount ref; public: void AddRef(); void Release();