Merge pull request #79151 from RedworkDE/net-unregister-godotobject-check

C#: Add null check before calling `UnregisterGodotObject`
This commit is contained in:
Rémi Verschelde 2023-07-07 16:05:28 +02:00
commit c3b0a92c3c
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -125,7 +125,10 @@ namespace Godot
NativePtr = IntPtr.Zero;
}
DisposablesTracker.UnregisterGodotObject(this, _weakReferenceToSelf);
if (_weakReferenceToSelf != null)
{
DisposablesTracker.UnregisterGodotObject(this, _weakReferenceToSelf);
}
}
/// <summary>