diff options
author | Ignacio Etcheverry <neikeq@users.noreply.github.com> | 2019-02-19 01:02:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-19 01:02:20 +0100 |
commit | 29fd942dd6e6851014da8d3da9a7fcdca2921781 (patch) | |
tree | d73add68409b89abc479997c2836403a8b0ff336 /modules/mono/glue/Managed/Files/RID.cs | |
parent | e1f01bf2ac8ed0fb89a3f42a64529ddf0114fbf5 (diff) | |
parent | efd5d4bcf9fc15a92ef40e3f6edb185d190cd50e (diff) |
Merge pull request #26039 from neikeq/throw_objectdisposedexception
C#: Throw ObjectDisposedException from disposed wrapper classes
Diffstat (limited to 'modules/mono/glue/Managed/Files/RID.cs')
-rw-r--r-- | modules/mono/glue/Managed/Files/RID.cs | 8 |
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() |