1
0
Fork 0

Use a critical section to guard the GuiTranslateText (#1011)

* Translate some strings and export memiscodepage.

* fixed memory leaks in watch view

* warn the user if the breakpoint is not executable

* use dbgfunctions

* remove unused exports

* fix

* fix

* guard translate function with critical section

* DeleteCriticalSection
This commit is contained in:
Torusrxxx 2016-08-26 15:10:57 +00:00 committed by Duncan Ogilvie
parent c076aa583c
commit bdefeea0ad
1 changed files with 5 additions and 1 deletions

View File

@ -107,6 +107,7 @@ BRIDGE_IMPEXP const wchar_t* BridgeStart()
return L"Failed to save settings!";
_dbg_sendmessage(DBG_DEINITIALIZE_LOCKS, nullptr, nullptr); //deinitialize locks when only one thread is left (hopefully)
DeleteCriticalSection(&csIni);
DeleteCriticalSection(&csTranslate);
return 0;
}
@ -1487,7 +1488,10 @@ BRIDGE_IMPEXP void GuiFoldDisassembly(duint startAddress, duint length)
BRIDGE_IMPEXP const char* GuiTranslateText(const char* Source)
{
return _gui_translate_text(Source);
EnterCriticalSection(&csTranslate);
const char* text = _gui_translate_text(Source);
LeaveCriticalSection(&csTranslate);
return text;
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)