From 231e75328952e3bc3be859c875e454177558e283 Mon Sep 17 00:00:00 2001 From: Reijo Tomperi Date: Sun, 16 Nov 2008 15:39:42 +0000 Subject: [PATCH] Refactoring: static variable in CheckMemoryLeak is now a private member of the class. --- CheckMemoryLeak.cpp | 18 ------------------ CheckMemoryLeak.h | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/CheckMemoryLeak.cpp b/CheckMemoryLeak.cpp index bbc026e9e..226253ec7 100644 --- a/CheckMemoryLeak.cpp +++ b/CheckMemoryLeak.cpp @@ -71,24 +71,6 @@ bool CheckMemoryLeakClass::isclass( const std::string &typestr ) } //--------------------------------------------------------------------------- - - - -// Extra allocation.. -class AllocFunc -{ - public: - const char *funcname; - AllocType alloctype; - - AllocFunc(const char f[], AllocType a) - { - funcname = f; - alloctype = a; - } -}; -static std::list listallocfunc; - AllocType CheckMemoryLeakClass::GetAllocationType( const TOKEN *tok2 ) { // What we may have... diff --git a/CheckMemoryLeak.h b/CheckMemoryLeak.h index 0624265a4..c59134421 100644 --- a/CheckMemoryLeak.h +++ b/CheckMemoryLeak.h @@ -40,6 +40,20 @@ public: void CheckMemoryLeak(); private: + // Extra allocation.. + class AllocFunc + { + public: + const char *funcname; + AllocType alloctype; + + AllocFunc(const char f[], AllocType a) + { + funcname = f; + alloctype = a; + } + }; + void CheckMemoryLeak_ClassMembers_Variable( const std::vector &classname, const char varname[] ); void CheckMemoryLeak_ClassMembers_ParseClass( const TOKEN *tok1, std::vector &classname ); void CheckMemoryLeak_ClassMembers(); @@ -60,6 +74,7 @@ private: Tokenizer *_tokenizer; Settings _settings; + std::list listallocfunc; }; //---------------------------------------------------------------------------