Fix a bug in TextInputBuffer

internals
Eric Mellino 8 years ago
parent c09777c4e3
commit cd275b91b5
  1. 3
      src/ImGui.NET/TextInputBuffer.cs

@ -104,6 +104,9 @@ namespace ImGuiNET
unsafe unsafe
{ {
Unsafe.CopyBlock(Buffer.ToPointer(), tempNativeString.ToPointer(), bytesToCopy); Unsafe.CopyBlock(Buffer.ToPointer(), tempNativeString.ToPointer(), bytesToCopy);
byte* endOfData = (byte*)Buffer.ToPointer() + bytesToCopy;
uint bytesToClear = _length - bytesToCopy;
Unsafe.InitBlock(endOfData, 0, bytesToClear);
} }
Marshal.FreeHGlobal(tempNativeString); Marshal.FreeHGlobal(tempNativeString);
} }

Loading…
Cancel
Save