protected override void Dispose(bool disposingManagedResources) { if (disposingManagedResources) { } DB?.Close(); DB?.Dispose(); base.Dispose(disposingManagedResources); }
/// <summary> /// Free all resources created by the server factory /// </summary> public void Dispose() { StopAllServers(); foreach (KeyValuePair <string, TemplateServer> server in servers) { server.Value.Dispose(); } databaseDriver.Dispose(); }
protected override void Dispose(bool disposingManageResource) { if (_disposed) { return; } _disposed = true; if (disposingManageResource) { } DB?.Close(); DB?.Dispose(); }
protected override void Dispose(bool disposingManagedResources) { if (_disposed) { return; } _disposed = true; if (disposingManagedResources) { } DB.Close(); DB.Dispose(); base.Dispose(disposingManagedResources); }
protected virtual void Dispose(bool disposing) { if (Disposed) { return; } if (disposing) { // TODO: 释放托管状态(托管对象)。 StopServer(); } databaseDriver?.Dispose(); // TODO: 释放未托管的资源(未托管的对象)并在以下内容中替代终结器。 // TODO: 将大型字段设置为 null。 Disposed = true; }
protected override void Dispose(bool disposingManagedResources) { if (_disposed) { return; } _disposed = true; if (disposingManagedResources) { } PollTimer?.Stop(); PollTimer?.Dispose(); StatusTimer?.Stop(); StatusTimer?.Dispose(); // Disconnected all connected clients Console.WriteLine("Disconnecting all users..."); //Parallel.ForEach(LoggedInSession.Values, client => client.DisconnectByReason(DisconnectReason.ForcedServerShutdown)); //Parallel.ForEach(InLoginSession.Values, client => client.DisconnectByReason(DisconnectReason.ForcedServerShutdown)); //LoginQuery.ResetAllStatusAndSessionKey(); LoggedInSession.Clear(); DB.Dispose(); base.Dispose(disposingManagedResources); }