Skip to content

Commit

Permalink
fix #30 & #31
Browse files Browse the repository at this point in the history
  • Loading branch information
pangweiwei committed Nov 13, 2018
1 parent b7158d7 commit d2c8262
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Plugins/slua_unreal/Source/slua_unreal/Private/LuaState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,18 @@ namespace slua {
}

LuaVar LuaState::doString(const char* str, LuaVar* pEnv) {
// fix #31 & #30 issue,
// vc compile optimize code cause cl.exe dead loop in release mode(no WITH_EDITOR)
// if turn optimze flag on
// so just write complex code to bypass link optimize
// like this, WTF!
uint32 len = strlen(str);
#if WITH_EDITOR
FString md5FString = FMD5::HashAnsiString(UTF8_TO_TCHAR(str));
debugStringMap.Add(md5FString, UTF8_TO_TCHAR(str));
return doBuffer((const uint8*)str,strlen(str),TCHAR_TO_UTF8(*md5FString),pEnv);
return doBuffer((const uint8*)str,len,TCHAR_TO_UTF8(*md5FString),pEnv);
#else
return doBuffer((const uint8*)str,strlen(str),str,pEnv);
return doBuffer((const uint8*)str,len,str,pEnv);
#endif
}

Expand Down

0 comments on commit d2c8262

Please sign in to comment.