mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-15 20:03:15 +02:00
Merge pull request #572 from dydzio0614/FuzzyHelperCrash
Fix crash caused by FuzzyLite destructor
This commit is contained in:
@@ -23,7 +23,8 @@ extern FuzzyHelper * fh;
|
|||||||
|
|
||||||
engineBase::engineBase()
|
engineBase::engineBase()
|
||||||
{
|
{
|
||||||
engine.addRuleBlock(&rules);
|
rules = new fl::RuleBlock();
|
||||||
|
engine.addRuleBlock(rules);
|
||||||
}
|
}
|
||||||
|
|
||||||
void engineBase::configure()
|
void engineBase::configure()
|
||||||
@@ -34,7 +35,7 @@ void engineBase::configure()
|
|||||||
|
|
||||||
void engineBase::addRule(const std::string & txt)
|
void engineBase::addRule(const std::string & txt)
|
||||||
{
|
{
|
||||||
rules.addRule(fl::Rule::parse(txt, &engine));
|
rules->addRule(fl::Rule::parse(txt, &engine));
|
||||||
}
|
}
|
||||||
|
|
||||||
struct armyStructure
|
struct armyStructure
|
||||||
|
@@ -17,7 +17,7 @@ class engineBase //subclasses create fuzzylite variables with "new" that are not
|
|||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
fl::Engine engine;
|
fl::Engine engine;
|
||||||
fl::RuleBlock rules;
|
fl::RuleBlock * rules;
|
||||||
virtual void configure();
|
virtual void configure();
|
||||||
void addRule(const std::string & txt);
|
void addRule(const std::string & txt);
|
||||||
public:
|
public:
|
||||||
|
Reference in New Issue
Block a user