private void ClientForm_FormClosed(object sender, FormClosedEventArgs e) { //if (thread != null) //{ // thread.Abort(); //} //if (client != null) //{ // client.Close(); // client = null; //} updateClient = false; gameClient.Unload(); if (client != null) { client.Send(ProtocolType.Tcp, new Packet() { PacketType = PacketType.Disconnect, Content = participant.Nickname }); client.Disconnect(); } if (!gameProcess.HasExited) { Application.Exit(); } }