When my users are using my application, they notice some threads that are created and not destroyed. I could only explain it as CVI having some underlying code that creates it because my code does not use CreateThread() in those instances.
1) when menu is selected (not clicked on, just if menu bar is activated)
2) when LoadPanel() is selected
3) when FileSelectPopup() is used.
I guess I understand why (1) and (2) create threads that do not get cleared, but why doesn't the thread for FileSelectPopup() get cleared after I use it?
Attached is a sample app that shows (1) and (3). I tested it by using TaskManager. Look at
application,
- 1 thread is active upon initialization.
- When
menu is selected, there are 3 threads active.
- When (untitled) button is pressed, there are 7 threads active (sometimes 6).
I wait for a while, sometimes only 5 threads are active, but it never goes back to 1 thread.
What can I do to terminate those threads, so my users don't think I have a runaway thread causing them their thruput issues?