aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorred-001 <red-001@outlook.ie>2018-06-22 20:04:41 +0100
committerSmallJoker <SmallJoker@users.noreply.github.com>2018-06-22 21:04:41 +0200
commit07b1743d3db086f0f984968252d9e3ac71336a7e (patch)
tree044c064f3fbbd3be1d1908f60bfaa1a820512194
parentc66d97726931aa8dde7d8a1ffa5b8e41234f4660 (diff)
downloadminetest-07b1743d3db086f0f984968252d9e3ac71336a7e.tar.gz
minetest-07b1743d3db086f0f984968252d9e3ac71336a7e.tar.bz2
minetest-07b1743d3db086f0f984968252d9e3ac71336a7e.zip
Fix crash caused by Lua error during startup (#7473)
-rw-r--r--src/emerge.cpp5
1 files changed, 4 insertions, 1 deletions
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;