aboutsummaryrefslogtreecommitdiffstatsci
path: root/vulkan/Utf8StringPointer.cs
diff options
context:
space:
mode:
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