From c406d2476fc59a7a0e6f828646c262f51e84f343 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 17 Jan 2003 14:11:34 +0000 Subject: [PATCH] Removed the osg::Referenced::createCount() and deleteCount() methods and associated variables which were only compiled in on debug build. These optional methods/static vars were causingproblems when mixing debug and release builds. --- include/osg/Referenced | 23 +---------------------- src/osg/Referenced.cpp | 9 --------- src/osgUtil/SceneView.cpp | 13 ------------- 3 files changed, 1 insertion(+), 44 deletions(-) diff --git a/include/osg/Referenced b/include/osg/Referenced index ac23f1103..761b6b55d 100644 --- a/include/osg/Referenced +++ b/include/osg/Referenced @@ -23,15 +23,9 @@ class SG_EXPORT Referenced { _refCount=0; -#ifdef OSG_COMPILE_UNIT_TESTS - _createdCount ++; -#endif } Referenced(const Referenced&) { _refCount=0; -#ifdef OSG_COMPILE_UNIT_TESTS - _createdCount ++; -#endif } inline Referenced& operator = (Referenced&) { return *this; } @@ -67,26 +61,11 @@ class SG_EXPORT Referenced /** return the number pointers currently referencing this object. */ inline int referenceCount() const { return _refCount; } -#ifdef OSG_COMPILE_UNIT_TESTS - /** return the total number of created referenced objects */ - inline static int createdCount() { return _createdCount; } - - /** return the total number of deleted referenced objects */ - inline static int deletedCount() { return _deletedCount; } -#endif - - - + protected: virtual ~Referenced(); mutable int _refCount; - -#ifdef OSG_COMPILE_UNIT_TESTS - static int _createdCount; // incremented in the constructor - static int _deletedCount; // incremented in the destructor -#endif - }; diff --git a/src/osg/Referenced.cpp b/src/osg/Referenced.cpp index a868a7f4c..c0084a71b 100644 --- a/src/osg/Referenced.cpp +++ b/src/osg/Referenced.cpp @@ -17,12 +17,6 @@ DeleteHandler* Referenced::getDeleteHandler() return s_deleteHandler.get(); } - -#ifdef OSG_COMPILE_UNIT_TESTS -int Referenced::_createdCount = 0; -int Referenced::_deletedCount = 0; -#endif - Referenced::~Referenced() { if (_refCount>0) @@ -30,9 +24,6 @@ Referenced::~Referenced() notify(WARN)<<"Warning: deleting still referenced object "<