C#: Add null check before calling `UnregisterGodotObject`
(cherry picked from commit 693e6e036b
)
This commit is contained in:
parent
6018ff49d6
commit
69948f7489
|
@ -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