From 07b1743d3db086f0f984968252d9e3ac71336a7e Mon Sep 17 00:00:00 2001 From: red-001 Date: Fri, 22 Jun 2018 20:04:41 +0100 Subject: [PATCH] Fix crash caused by Lua error during startup (#7473) --- src/emerge.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/emerge.cpp b/src/emerge.cpp index 277841053..592b1bef7 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -169,7 +169,10 @@ EmergeManager::~EmergeManager() } delete thread; - delete m_mapgens[i]; + + // Mapgen init might not be finished if there is an error during startup. + if (m_mapgens.size() > i) + delete m_mapgens[i]; } delete biomemgr; -- 2.25.1