From aeb3154257299f6f70da92e4d04616cc3da2a88c Mon Sep 17 00:00:00 2001 From: Exzap <13877693+Exzap@users.noreply.github.com> Date: Sun, 17 Aug 2025 17:58:22 +0200 Subject: [PATCH] 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 --- src/gui/wxgui/debugger/DisasmCtrl.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/wxgui/debugger/DisasmCtrl.cpp b/src/gui/wxgui/debugger/DisasmCtrl.cpp index 627d0681..7b24cb09 100644 --- a/src/gui/wxgui/debugger/DisasmCtrl.cpp +++ b/src/gui/wxgui/debugger/DisasmCtrl.cpp @@ -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 (OpenClipboard(nullptr)) { @@ -703,9 +704,7 @@ void DisasmCtrl::CopyToClipboard(std::string text) { { memcpy(GlobalLock(hGlobal), text.c_str(), text.size() + 1); GlobalUnlock(hGlobal); - SetClipboardData(CF_TEXT, hGlobal); - GlobalFree(hGlobal); } CloseClipboard(); }