I am getting a lot of occurences of the message “Debug session in progress. Terminate?” when trying to re-run my application after routine editing in Delphi 2010. My Application has already been run (maybe several times) and quits without any problem back into my editing mode, yet after completing my edit sometimes the Run option is disabled and I get this “Debug session in progress. Terminate?” message. I then have to be careful to save my edits, and then use the Windows ‘Close Window’ to abort Delphi and restart the IDE. My Application is quite large and uses FastMM4. I’d like to eliminate problem but would be happy with a neater way of detatching the debugger from whatever it is latched on to. Any suggestions?
Incidently, my App compiles fully (and is released using) Delphi 7 in which I have no problems at all, not even when I Ctrl-F2 from within the middle of executing my App.
Chances are some thread in your app is still running keeping your appl from terminating fully and thus keeping the debug session alive. Depending on the state of your app and the rest of the app’s termination process, you could in that case still have “running” in the IDE’s caption.
frogb’s question about hitting Ctrl-F2, was (I am guessing) to see whether that was indeed the case. If you hit Ctrl-F2 when your app is fully terminated, nothing should happen. However, if some thread is somehow still active and keeping the debug session alive, Ctrl-F2 should terminate it and if your IDE’s caption showed “running” that should now disappear.
The fact that you can hit Ctrl-F2 in D7 even when your app is still running and have it end correctly is to be expected. That is exactly what Ctrl-F2 is for: ending all still running threads (pretty roughly I might add).