private void ShutdownInstance(string identifier, TenantInstance instance) { if (instance == null) { return; } // Make sure all cache entries for this instance are removed (they are all dependent on tenant instance id) Log("Removing instance '{0}' identifier '{1}'", instance.Id, identifier); runningInstances.Remove(instance.Id.ToString()); lock (instance) { instance.Dispose(); } }