From 95f2706d1cc04ce9c1fbab3f171954762f755fff Mon Sep 17 00:00:00 2001 From: omar Date: Sat, 5 Aug 2017 16:05:48 +0800 Subject: [PATCH] Clipboard: [windows] Fixed not closing win32 clipboard on early return. (#1264) --- imgui.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/imgui.cpp b/imgui.cpp index 8db2b250..9d3cb1ba 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -9655,7 +9655,10 @@ static const char* GetClipboardTextFn_DefaultImpl(void*) return NULL; HANDLE wbuf_handle = GetClipboardData(CF_UNICODETEXT); if (wbuf_handle == NULL) + { + CloseClipboard(); return NULL; + } if (ImWchar* wbuf_global = (ImWchar*)GlobalLock(wbuf_handle)) { int buf_len = ImTextCountUtf8BytesFromStr(wbuf_global, NULL) + 1;