Fixed an order-of-operations crash within the Quest Parser classes

This commit is contained in:
SecretsOTheP 2014-02-14 12:30:50 -05:00
parent 5f02de1c95
commit 46f8723314
3 changed files with 11 additions and 2 deletions

View File

@ -46,6 +46,12 @@ void QuestParserCollection::RegisterQuestInterface(QuestInterface *qi, std::stri
_load_precedence.push_back(qi);
}
void QuestParserCollection::ClearInterfaces() {
_interfaces.clear();
_extensions.clear();
_load_precedence.clear();
}
void QuestParserCollection::AddVar(std::string name, std::string val) {
std::list<QuestInterface*>::iterator iter = _load_precedence.begin();
while(iter != _load_precedence.end()) {

View File

@ -39,7 +39,8 @@ public:
~QuestParserCollection();
void RegisterQuestInterface(QuestInterface *qi, std::string ext);
void UnRegisterQuestInterface(QuestInterface *qi, std::string ext);
void ClearInterfaces();
void AddVar(std::string name, std::string val);
void Init();
void ReloadQuests(bool reset_timers = true);

View File

@ -476,6 +476,8 @@ int main(int argc, char** argv) {
entity_list.Clear();
parse->ClearInterfaces();
#ifdef EMBPERL
safe_delete(perl_parser);
#endif
@ -496,7 +498,7 @@ int main(int argc, char** argv) {
dbasync->StopThread();
safe_delete(taskmanager);
command_deinit();
safe_delete(parse);
CheckEQEMuErrorAndPause();
_log(ZONE__INIT, "Proper zone shutdown complete.");
return 0;