Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Quick workaround for crashing destructor on Mingw32
closes #10137
  • Loading branch information
sfan5 committed Jul 9, 2020
1 parent 21de17e commit 70df3d5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/script/common/c_converter.cpp
Expand Up @@ -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)
Expand Down

0 comments on commit 70df3d5

Please sign in to comment.