Programm terminiert jetzt beim schließen

This commit is contained in:
2014-05-02 11:44:52 +02:00
parent 89da875d39
commit eb52b42c60
4 changed files with 9 additions and 9 deletions

View File

@@ -135,8 +135,7 @@ namespace WorldOfPeacecraft
public void Stop() {
Parse.Stop ();
Send.Stop ();
Rec.Stop ();
System.Windows.Forms.Application.Exit ();
Client.Close ();
}
}
}

View File

@@ -465,6 +465,7 @@ namespace WorldOfPeacecraft
public void Stop ()
{
ParserThread.Abort ();
ParserThread.Join ();
}
private class Block

View File

@@ -27,8 +27,12 @@ namespace WorldOfPeacecraft
private void doReceive ()
{
this.Reader = new StreamReader (Client.GetStream ());
while (true) {
ReceiverBuffer.AddLine(Receive());
try {
while (true) {
ReceiverBuffer.AddLine (Receive ());
}
} catch (ObjectDisposedException e) {
// Nothing to do
}
}
@@ -36,10 +40,5 @@ namespace WorldOfPeacecraft
{
ReceiverThread.Start ();
}
public void Stop()
{
ReceiverThread.Abort ();
}
}
}

View File

@@ -41,6 +41,7 @@ namespace WorldOfPeacecraft
public void Stop()
{
SenderThread.Abort();
SenderThread.Join();
}
}
}