aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;