Add NativeInteropException for native interop crashes

This commit is contained in:
2023-05-19 13:52:30 +02:00
parent ed70eb24c7
commit 3e792e6cd7
3 changed files with 21 additions and 8 deletions
@@ -261,7 +261,7 @@ namespace FlaxEngine.Interop
return;
}
throw new Exception("Tried to free non-pooled ManagedArray as pooled ManagedArray");
throw new NativeInteropException("Tried to free non-pooled ManagedArray as pooled ManagedArray");
}
}
}
@@ -499,7 +499,7 @@ namespace FlaxEngine.Interop
else if (weakPoolOther.TryGetValue(handle, out value))
return value;
throw new Exception("Invalid ManagedHandle");
throw new NativeInteropException("Invalid ManagedHandle");
}
internal static void SetObject(IntPtr handle, object value)
@@ -527,7 +527,7 @@ namespace FlaxEngine.Interop
else if (weakPoolOther.ContainsKey(handle))
weakPoolOther[handle] = value;
throw new Exception("Invalid ManagedHandle");
throw new NativeInteropException("Invalid ManagedHandle");
}
internal static void FreeHandle(IntPtr handle)
@@ -556,7 +556,7 @@ namespace FlaxEngine.Interop
else
return;
throw new Exception("Invalid ManagedHandle");
throw new NativeInteropException("Invalid ManagedHandle");
}
}
}