mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
Add missing EmptyClipboard (#1584)
* Add missing EmptyClipboard * Fix missing GlobalUnlock
This commit is contained in:
parent
9ca2d34f95
commit
6eb8153a99
1 changed files with 4 additions and 1 deletions
|
|
@ -131,6 +131,7 @@ internal sealed unsafe class ImGuiClipboardFunctionProvider : IServiceType, IDis
|
|||
ptr[str.Length] = default;
|
||||
GlobalUnlock(hMem);
|
||||
|
||||
EmptyClipboard();
|
||||
SetClipboardData(CF.CF_UNICODETEXT, hMem);
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
@ -158,9 +159,9 @@ internal sealed unsafe class ImGuiClipboardFunctionProvider : IServiceType, IDis
|
|||
return this.clipboardData.Data;
|
||||
}
|
||||
|
||||
var hMem = (HGLOBAL)GetClipboardData(CF.CF_UNICODETEXT);
|
||||
try
|
||||
{
|
||||
var hMem = (HGLOBAL)GetClipboardData(CF.CF_UNICODETEXT);
|
||||
if (hMem != default)
|
||||
{
|
||||
var ptr = (char*)GlobalLock(hMem);
|
||||
|
|
@ -191,6 +192,8 @@ internal sealed unsafe class ImGuiClipboardFunctionProvider : IServiceType, IDis
|
|||
}
|
||||
finally
|
||||
{
|
||||
if (hMem != default)
|
||||
GlobalUnlock(hMem);
|
||||
CloseClipboard();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue