Refactoring: static variable in CheckMemoryLeak is now a private member of the class.

This commit is contained in:
Reijo Tomperi 2008-11-16 15:39:42 +00:00
parent ce08224547
commit 231e753289
2 changed files with 15 additions and 18 deletions

View File

@ -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<AllocFunc> listallocfunc;
AllocType CheckMemoryLeakClass::GetAllocationType( const TOKEN *tok2 )
{
// What we may have...

View File

@ -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<const char *> &classname, const char varname[] );
void CheckMemoryLeak_ClassMembers_ParseClass( const TOKEN *tok1, std::vector<const char *> &classname );
void CheckMemoryLeak_ClassMembers();
@ -60,6 +74,7 @@ private:
Tokenizer *_tokenizer;
Settings _settings;
std::list<AllocFunc> listallocfunc;
};
//---------------------------------------------------------------------------