Close the clipboard if we fail to empty it

This commit is contained in:
Lukas Dürrenberger 2024-05-25 00:30:51 +02:00 committed by Chris Thrasher
parent 1a4003fcc0
commit 06946793b4

View File

@ -81,6 +81,7 @@ void ClipboardImpl::setString(const String& text)
if (!EmptyClipboard()) if (!EmptyClipboard())
{ {
std::cerr << "Failed to empty the Win32 clipboard." << std::endl; std::cerr << "Failed to empty the Win32 clipboard." << std::endl;
CloseClipboard();
return; return;
} }