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(); Disposables.Clear();
if ( Workshop != null )
{
Workshop.Dispose(); Workshop.Dispose();
Workshop = null; Workshop = null;
}
if ( Inventory != null )
{
Inventory.Dispose(); Inventory.Dispose();
Inventory = null; Inventory = null;
}
if ( Networking != null )
{
Networking.Dispose(); Networking.Dispose();
Networking = null; Networking = null;
}
if ( native != null ) if ( native != null )
{ {