diff --git a/lib/mapObjects/CQuest.cpp b/lib/mapObjects/CQuest.cpp index 2a565d0b6..4db528674 100644 --- a/lib/mapObjects/CQuest.cpp +++ b/lib/mapObjects/CQuest.cpp @@ -498,7 +498,9 @@ IQuestObject::IQuestObject(): IQuestObject::~IQuestObject() { - delete quest; + ///Information about quest should remain accessible even if IQuestObject removed from map + ///All CQuest objects are freed in CMap destructor + //delete quest; } bool IQuestObject::checkQuest(const CGHeroInstance* h) const diff --git a/lib/mapping/CMap.cpp b/lib/mapping/CMap.cpp index 2b30f3819..ca27432f0 100644 --- a/lib/mapping/CMap.cpp +++ b/lib/mapping/CMap.cpp @@ -245,6 +245,9 @@ CMap::~CMap() for(auto obj : objects) obj.dellNull(); + + for(auto quest : quests) + quest.dellNull(); } void CMap::removeBlockVisTiles(CGObjectInstance * obj, bool total)