From 971dea7efd3b9328f0a6f1acbfc2f81d47be7417 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 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; -- 2.25.1