Merge pull request #469 from lasergnu/SEGV

Fix SEGV on Solaris x86
This commit is contained in:
amai2012 2014-11-25 17:01:00 +01:00
commit 0913a51ccd
2 changed files with 5 additions and 4 deletions

View File

@ -42,3 +42,7 @@ void Check::reportError(const ErrorLogger::ErrorMessage &errmsg)
{
std::cout << errmsg.toXML(true, 1) << std::endl;
}
std::list<Check *> &Check::instances() {
static std::list<Check *> *_instances= new std::list<Check *>;
return *_instances;
}

View File

@ -53,10 +53,7 @@ public:
}
/** List of registered check classes. This is used by Cppcheck to run checks and generate documentation */
static std::list<Check *> &instances() {
static std::list<Check *> _instances;
return _instances;
}
static std::list<Check *> &instances();
/** run checks, the token list is not simplified */
virtual void runChecks(const Tokenizer *, const Settings *, ErrorLogger *) {