You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-18 14:21:41 +00:00
C#: Throw ObjectDisposedException from disposed wrapper classes
This commit is contained in:
@@ -30,7 +30,13 @@ namespace Godot
|
||||
|
||||
internal static IntPtr GetPtr(Object instance)
|
||||
{
|
||||
return instance == null ? IntPtr.Zero : instance.ptr;
|
||||
if (instance == null)
|
||||
return IntPtr.Zero;
|
||||
|
||||
if (instance.disposed)
|
||||
throw new ObjectDisposedException(instance.GetType().FullName);
|
||||
|
||||
return instance.ptr;
|
||||
}
|
||||
|
||||
~Object()
|
||||
|
||||
Reference in New Issue
Block a user