From aef7b223e14c5b57e5e534544bef389ff073c155 Mon Sep 17 00:00:00 2001 From: Ben Parsons <9parsonsb@gmail.com> Date: Mon, 24 Jul 2023 22:39:58 +1000 Subject: [PATCH] Use StringToHGlobalAnsi for UTF8Buffer rather then StringToCoTaskMemUTF8 tested on Windows 11 (x64) & Arch Linux (x64) should fix #172 --- Raylib-cs/types/native/UTF8Buffer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Raylib-cs/types/native/UTF8Buffer.cs b/Raylib-cs/types/native/UTF8Buffer.cs index c053303..4dd201d 100644 --- a/Raylib-cs/types/native/UTF8Buffer.cs +++ b/Raylib-cs/types/native/UTF8Buffer.cs @@ -13,7 +13,7 @@ namespace Raylib_cs public UTF8Buffer(string text) { - data = Marshal.StringToCoTaskMemUTF8(text); + this.data = Marshal.StringToHGlobalAnsi(text); } public unsafe sbyte* AsPointer() @@ -23,7 +23,7 @@ namespace Raylib_cs public void Dispose() { - Marshal.FreeCoTaskMem(data); + Marshal.FreeHGlobal(data); } }