Browse Source

Nullkiller: fix crash because of incorrect memory management

Andrii Danylchenko 4 years ago
parent
commit
673d908c40
1 changed files with 1 additions and 2 deletions
  1. 1 2
      AI/Nullkiller/VCAI.cpp

+ 1 - 2
AI/Nullkiller/VCAI.cpp

@@ -70,6 +70,7 @@ VCAI::~VCAI()
 {
 	LOG_TRACE(logAi);
 	finish();
+	nullkiller.reset();
 }
 
 void VCAI::availableCreaturesChanged(const CGDwelling * town)
@@ -1485,8 +1486,6 @@ void VCAI::finish()
 		makingTurn->join();
 		makingTurn.reset();
 	}
-
-	nullkiller.reset();
 }
 
 void VCAI::requestActionASAP(std::function<void()> whatToDo)