From ee0a7dccc1eec0538d11bc67db9adba94b4aef21 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bruyère Date: Mon, 6 Dec 2021 20:41:56 +0100 Subject: struct size ok --- vulkan/Utf8StringPointer.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'vulkan/Utf8StringPointer.cs') diff --git a/vulkan/Utf8StringPointer.cs b/vulkan/Utf8StringPointer.cs index 943fe75..e75fd64 100644 --- a/vulkan/Utf8StringPointer.cs +++ b/vulkan/Utf8StringPointer.cs @@ -27,7 +27,10 @@ namespace Vulkan => handle == IntPtr.Zero ? "" : System.Runtime.InteropServices.Marshal.PtrToStringUTF8 (handle); public void Dispose() { - handle.Unpin(); + if (handle != IntPtr.Zero) { + handle.Unpin(); + handle = IntPtr.Zero; + } } } } \ No newline at end of file -- cgit v1.3.1-4-g156e