aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2020-07-09 22:01:46 +0200
committersfan5 <sfan5@live.de>2020-07-09 22:01:46 +0200
commit70df3d54f37c280f7afe60f6e964b8406577f39f (patch)
treebff7030c621dd2ce7bba8d76009305737516a6f6
parent21de17e3b695f3fcb0462f4aeb2a6ff733d0d282 (diff)
downloadminetest-70df3d54f37c280f7afe60f6e964b8406577f39f.tar.gz
minetest-70df3d54f37c280f7afe60f6e964b8406577f39f.tar.bz2
minetest-70df3d54f37c280f7afe60f6e964b8406577f39f.zip
Quick workaround for crashing destructor on Mingw32
closes #10137
-rw-r--r--src/script/common/c_converter.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/script/common/c_converter.cpp b/src/script/common/c_converter.cpp
index de0cdfbf4..eb6ab5331 100644
--- a/src/script/common/c_converter.cpp
+++ b/src/script/common/c_converter.cpp
@@ -457,9 +457,17 @@ size_t read_stringlist(lua_State *L, int index, std::vector<std::string> *result
Table field getters
*/
+#if defined(__MINGW32__) && !defined(__MINGW64__)
+/* MinGW 32-bit somehow crashes in the std::set destructor when this
+ * variable is thread-local, so just don't do that. */
+static std::set<u64> warned_msgs;
+#endif
+
bool check_field_or_nil(lua_State *L, int index, int type, const char *fieldname)
{
- static thread_local std::set<u64> warned_msgs;
+#if !defined(__MINGW32__) || defined(__MINGW64__)
+ thread_local std::set<u64> warned_msgs;
+#endif
int t = lua_type(L, index);
if (t == LUA_TNIL)