mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-12-11 16:37:02 +00:00
debugger: Fix clipboard related crash
When copying an address from Cemu's debugger and pasting it into Cemu (anywhere) it would crash because the memory was released prematurely
This commit is contained in:
parent
d7c510ed31
commit
aeb3154257
1 changed files with 2 additions and 3 deletions
|
|
@ -693,7 +693,8 @@ void DisasmCtrl::OnMouseDClick(const wxPoint& position, uint32 line)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisasmCtrl::CopyToClipboard(std::string text) {
|
void DisasmCtrl::CopyToClipboard(std::string text)
|
||||||
|
{
|
||||||
#if BOOST_OS_WINDOWS
|
#if BOOST_OS_WINDOWS
|
||||||
if (OpenClipboard(nullptr))
|
if (OpenClipboard(nullptr))
|
||||||
{
|
{
|
||||||
|
|
@ -703,9 +704,7 @@ void DisasmCtrl::CopyToClipboard(std::string text) {
|
||||||
{
|
{
|
||||||
memcpy(GlobalLock(hGlobal), text.c_str(), text.size() + 1);
|
memcpy(GlobalLock(hGlobal), text.c_str(), text.size() + 1);
|
||||||
GlobalUnlock(hGlobal);
|
GlobalUnlock(hGlobal);
|
||||||
|
|
||||||
SetClipboardData(CF_TEXT, hGlobal);
|
SetClipboardData(CF_TEXT, hGlobal);
|
||||||
GlobalFree(hGlobal);
|
|
||||||
}
|
}
|
||||||
CloseClipboard();
|
CloseClipboard();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue