summaryrefslogtreecommitdiff
path: root/modules/mono/glue/Managed/Files/RID.cs
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mono/glue/Managed/Files/RID.cs')
-rw-r--r--modules/mono/glue/Managed/Files/RID.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/mono/glue/Managed/Files/RID.cs b/modules/mono/glue/Managed/Files/RID.cs
index b862b8cac0..c8564f7619 100644
--- a/modules/mono/glue/Managed/Files/RID.cs
+++ b/modules/mono/glue/Managed/Files/RID.cs
@@ -11,7 +11,13 @@ namespace Godot
internal static IntPtr GetPtr(RID 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;
}
~RID()