views:

226

answers:

2

Hello,

Visual Studio 2005 C++ Windows XP Pro

I have a sample application that I am testing, that links with boost libraries.

However, the program runs ok. However, when I try and stop the program by clicking the 'Stop Debugging' button. The program ends, but the console window remains open. So I have many of them, as during my testing I am starting and stopping the application.

Even when I try and close it by clicking the close button it has no affect. And it doesn't seem to appear under task manager when the program ends.

The only way I can close them if I reboot windows.

I am thinking it might be a thread that has not closed, and maybe that is keeping the console windows open.

Many thanks for any advice,

+1  A: 

I have also seen this issue, I think it happens when a mutex or semaphore is still locked, or a thread hasn't cleanly exited. The only way I've found to prevent this is to make sure all mutexes/ semaphores/threads are cleaned up after before stopping the debugger.

Also it's interesting to note that this problem doesn't happen on Windows 7 or Linux. I have tried stopping the same program at the same places and the program always cleanly exits.

Good luck and happy coding!

Sam Post
+1  A: 

Have seen description of issue here: http://blogs.msdn.com/debugger/archive/2010/03/11/help-my-console-windows-won-t-go-away.aspx

Mykola