Null ref checks on dispose

This commit is contained in:
Garry Newman 2016-10-21 11:00:24 +01:00
parent 5d23345955
commit b4c48242cb

View File

@ -25,14 +25,23 @@ public virtual void Dispose()
}
Disposables.Clear();
Workshop.Dispose();
Workshop = null;
if ( Workshop != null )
{
Workshop.Dispose();
Workshop = null;
}
Inventory.Dispose();
Inventory = null;
if ( Inventory != null )
{
Inventory.Dispose();
Inventory = null;
}
Networking.Dispose();
Networking = null;
if ( Networking != null )
{
Networking.Dispose();
Networking = null;
}
if ( native != null )
{