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-Url: https://git.librecmc.org/?a=commitdiff_plain;h=971dea7efd3b9328f0a6f1acbfc2f81d47be7417;p=oweals%2Fminetest.git Fix crash caused by Lua error during startup (#7473) --- diff --git a/src/emerge.cpp b/src/emerge.cpp index f7f6ff603..2f0dc8750 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -146,7 +146,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;