C#: Add null check before calling UnregisterGodotObject
This commit is contained in:
parent
443820686c
commit
693e6e036b
1 changed files with 4 additions and 1 deletions
|
|
@ -125,7 +125,10 @@ namespace Godot
|
|||
NativePtr = IntPtr.Zero;
|
||||
}
|
||||
|
||||
DisposablesTracker.UnregisterGodotObject(this, _weakReferenceToSelf);
|
||||
if (_weakReferenceToSelf != null)
|
||||
{
|
||||
DisposablesTracker.UnregisterGodotObject(this, _weakReferenceToSelf);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue