Skip to content

Commit aeb3154

Browse files
committed
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
1 parent d7c510e commit aeb3154

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/gui/wxgui/debugger/DisasmCtrl.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,8 @@ void DisasmCtrl::OnMouseDClick(const wxPoint& position, uint32 line)
693693
}
694694
}
695695

696-
void DisasmCtrl::CopyToClipboard(std::string text) {
696+
void DisasmCtrl::CopyToClipboard(std::string text)
697+
{
697698
#if BOOST_OS_WINDOWS
698699
if (OpenClipboard(nullptr))
699700
{
@@ -703,9 +704,7 @@ void DisasmCtrl::CopyToClipboard(std::string text) {
703704
{
704705
memcpy(GlobalLock(hGlobal), text.c_str(), text.size() + 1);
705706
GlobalUnlock(hGlobal);
706-
707707
SetClipboardData(CF_TEXT, hGlobal);
708-
GlobalFree(hGlobal);
709708
}
710709
CloseClipboard();
711710
}

0 commit comments

Comments
 (0)