fix: #36 Operate clipboard cause program crash

This commit is contained in:
yuanyuanxiang
2025-01-14 23:59:47 +08:00
parent 483d090515
commit 34c7287371
2 changed files with 4 additions and 4 deletions

View File

@@ -185,8 +185,8 @@ VOID CScreenManager::UpdateClientClipboard(char *szBuffer, ULONG ulLength)
return;
memcpy(szClipboardVirtualAddress, szBuffer, ulLength);
GlobalUnlock(hGlobal);
SetClipboardData(CF_TEXT, hGlobal);
GlobalFree(hGlobal);
if(NULL==SetClipboardData(CF_TEXT, hGlobal))
GlobalFree(hGlobal);
}
CloseClipboard();
}