]> git.lizzy.rs Git - irrlicht.git/commitdiff
Delete leak hunter
authorsfan5 <sfan5@live.de>
Mon, 2 Jan 2023 19:37:18 +0000 (20:37 +0100)
committersfan5 <sfan5@live.de>
Mon, 2 Jan 2023 19:37:18 +0000 (20:37 +0100)
include/IReferenceCounted.h
include/leakHunter.h [deleted file]
source/Irrlicht/CMakeLists.txt
source/Irrlicht/leakHunter.cpp [deleted file]

index 42dfc92a6e6ad46b3c474c041a8c93f067210614..8a551e8c469b7ff9b7baa68a362da35569583469 100644 (file)
@@ -7,10 +7,6 @@
 \r
 #include "irrTypes.h"\r
 \r
-#ifdef _IRR_COMPILE_WITH_LEAK_HUNTER_\r
-       #include "leakHunter.h"\r
-#endif\r
-\r
 namespace irr\r
 {\r
 \r
@@ -50,17 +46,11 @@ namespace irr
                IReferenceCounted()\r
                        : DebugName(0), ReferenceCounter(1)\r
                {\r
-#ifdef _IRR_COMPILE_WITH_LEAK_HUNTER_\r
-                       LeakHunter::addObject(this);\r
-#endif\r
                }\r
 \r
                //! Destructor.\r
                virtual ~IReferenceCounted()\r
                {\r
-                       #ifdef _IRR_COMPILE_WITH_LEAK_HUNTER_\r
-                               LeakHunter::removeObject(this);\r
-                       #endif\r
                }\r
 \r
                //! Grabs the object. Increments the reference counter by one.\r
diff --git a/include/leakHunter.h b/include/leakHunter.h
deleted file mode 100644 (file)
index 4e1ada4..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright (C) 2013 Michael Zeilfelder\r
-// This file is part of the "Irrlicht Engine".\r
-// For conditions of distribution and use, see copyright notice in irrlicht.h\r
-\r
-#ifndef __LEAK_HUNTER_INCLUDED__\r
-#define __LEAK_HUNTER_INCLUDED__\r
-\r
-#include "IrrCompileConfig.h"\r
-\r
-#ifdef _IRR_COMPILE_WITH_LEAK_HUNTER_\r
-\r
-#include "irrArray.h"\r
-\r
-namespace irr\r
-{\r
-       class IReferenceCounted;\r
-\r
-       //! A class helping to find unreleased objects of type IReferenceCounted.\r
-       /** To use this you have recompile Irrlicht with _IRR_COMPILE_WITH_LEAK_HUNTER_.\r
-               Note that this will slow down your application and should only be used for debugging.\r
-               The way to use is that you can check after you closed and dropped your last Irrlicht device\r
-               if there are still any IReferenceCounted left over which have not been deleted.\r
-       */\r
-       class LeakHunter\r
-       {\r
-               public:\r
-                       friend class IReferenceCounted;\r
-\r
-                       //! Clear all IReferenceCounted objects inside LeakHunter\r
-                       /** This does not affect the IReferenceCounted themselves only the\r
-                               counting of them. Usually you don't ever need to clear, but\r
-                               sometimes it helps when for example you want to ignore\r
-                               certain leaks.\r
-                       */\r
-                       static void clearReferenceCountedObjects()\r
-                       {\r
-                               ReferenceCountedObjects.clear();\r
-                       }\r
-\r
-                       //! Access all objects which are currently reference counted.\r
-                       static inline irr::core::array<const IReferenceCounted*> getReferenceCountedObjects()\r
-                       {\r
-                               return ReferenceCountedObjects;\r
-                       }\r
-\r
-               protected:\r
-                       static inline void addObject(const IReferenceCounted* object)\r
-                       {\r
-                               ReferenceCountedObjects.push_back(object);\r
-                       }\r
-\r
-                       static inline void removeObject(const IReferenceCounted* object)\r
-                       {\r
-                               irr::s32 idx = ReferenceCountedObjects.linear_search(object );\r
-                               if ( idx >= 0 )\r
-                               {\r
-                                       irr::core::swap( ReferenceCountedObjects[idx], ReferenceCountedObjects.getLast() );\r
-                                       ReferenceCountedObjects.erase( ReferenceCountedObjects.size()-1 );\r
-                               }\r
-                       }\r
-\r
-               private:\r
-                       // NOTE: We don't do additional grab()/drop()'s here as we want to supervise reference counted objects and not affect them otherwise.\r
-                       IRRLICHT_API static irr::core::array<const IReferenceCounted*> ReferenceCountedObjects;\r
-       };\r
-} // end namespace irr\r
-\r
-#endif // _IRR_COMPILE_WITH_LEAK_HUNTER_\r
-\r
-#endif\r
index 57a43048f5c4e1c6d0a1842797d912c86625e481..2a3045c4a89fa896e43a6110b40b8ba1a1068a1c 100644 (file)
@@ -241,7 +241,6 @@ add_library(IRROTHEROBJ OBJECT
        COSOperator.cpp
        Irrlicht.cpp
        os.cpp
-       leakHunter.cpp
        CProfiler.cpp
 )
 
diff --git a/source/Irrlicht/leakHunter.cpp b/source/Irrlicht/leakHunter.cpp
deleted file mode 100644 (file)
index 4935767..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (C) 2013 Michael Zeilfelder\r
-// This file is part of the "Irrlicht Engine".\r
-// For conditions of distribution and use, see copyright notice in irrlicht.h\r
-\r
-#include "leakHunter.h"\r
-\r
-#ifdef _IRR_COMPILE_WITH_LEAK_HUNTER_\r
-\r
-namespace irr\r
-{\r
-        irr::core::array<const IReferenceCounted*> LeakHunter::ReferenceCountedObjects;\r
-} // end namespace irr\r
-\r
-#endif // _IRR_COMPILE_WITH_LEAK_HUNTER_\r
-\r