C# program not closing properly

Started by
3 comments, last by Side Winder 15 years, 12 months ago
Hey, my program isn't closing properly after the streams/threads have been started. I'll close it, but it'll still show up in the process manager. What could be causing this? Cheers.
Advertisement
Using the sacred power of the I Ching, I've divined that you're closing your program with the function ThisLooksLikeItClosesTheProgramButActuallyDoesnt(). This function looks like it closes the program, but it actually doesn't. Solution: don't use ThisLooksLikeItClosesTheProgramButActuallyDoesnt() to close your program.
As in, Application.Exit()? Ok... Then how do I close it properly?
Using the mystic power of the Tarot, I have divined that your extra threads do not contain message loops, and remain unaffected by Application.Exit(), and thus need to be closed separately before Application.Exit() can function. The Tarot also tells me that you don't have a loop condition that will terminate your threads cleanly, so needs some external force to terminate them such as calling Thread.Abort() on the thread objects.
Yeah I was Abort()ing the threads and the problem persisted but after some more looking around it seems my TcpListener was still running! Thanks for the help.

This topic is closed to new replies.

Advertisement