From: red-001 Date: Fri, 22 Jun 2018 19:04:41 +0000 (+0100) Subject: Fix crash caused by Lua error during startup (#7473) X-Git-Tag: 5.0.0~344 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=07b1743d3db086f0f984968252d9e3ac71336a7e;p=oweals%2Fminetest.git Fix crash caused by Lua error during startup (#7473) --- 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;