aboutsummaryrefslogtreecommitdiffstatsci
path: root/vulkan/Utf8StringPointer.cs
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2021-12-06 20:41:56 +0100
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2021-12-06 20:41:56 +0100
commitee0a7dccc1eec0538d11bc67db9adba94b4aef21 (patch)
tree6e6695667c5f76622fd825270399413caa3a44cd /vulkan/Utf8StringPointer.cs
parente31487324a18a58908ebe7b7e0acfb3c8b4ac144 (diff)
struct size ok
Diffstat (limited to 'vulkan/Utf8StringPointer.cs')
-rw-r--r--vulkan/Utf8StringPointer.cs5
1 files changed, 4 insertions, 1 deletions
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