mirror of https://github.com/godotengine/godot
Merge pull request #79151 from RedworkDE/net-unregister-godotobject-check
C#: Add null check before calling `UnregisterGodotObject`
This commit is contained in:
commit
c3b0a92c3c
|
|
@ -125,7 +125,10 @@ namespace Godot
|
|||
NativePtr = IntPtr.Zero;
|
||||
}
|
||||
|
||||
DisposablesTracker.UnregisterGodotObject(this, _weakReferenceToSelf);
|
||||
if (_weakReferenceToSelf != null)
|
||||
{
|
||||
DisposablesTracker.UnregisterGodotObject(this, _weakReferenceToSelf);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue