What should I use instead of while(true)?

I’m running a form application where the main form opens new threads (not new widows) and their function depends on running in an endless loop. However, whenever I close the main (and only) window, the opened threads continue running.

Is there an alternative to while(true) or is there a way to break it once a particular thread or main window is closed?

submitted by /u/grandtheftdox
[link] [comments]

Leave a Reply