C#: Add null check before calling `UnregisterGodotObject`
This commit is contained in:
parent
443820686c
commit
693e6e036b
|
@ -125,8 +125,11 @@ namespace Godot
|
|||
NativePtr = IntPtr.Zero;
|
||||
}
|
||||
|
||||
if (_weakReferenceToSelf != null)
|
||||
{
|
||||
DisposablesTracker.UnregisterGodotObject(this, _weakReferenceToSelf);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts this <see cref="GodotObject"/> to a string.
|
||||
|
|
Loading…
Reference in New Issue