Since I am using the stdlib function sprintf(...), I am calling CloseSTDLIB() just before calling __UHEAP_MARKEND, to take care of the memory leak message in the emulator debug version.

But this call to CloseSTDLIB is resulting in the following problem:

My program is an .exe, and the emulator is not exiting at the end of the problem, it instead displays the following message:

"Console closed - press any key"

But, I don't want the emulator to wait for human key press. Any suggestions how can I get around this "emulator waiting for key press" problem.

NOTE: if I remove the call to CloseSTDLIB() it doesn't wait for this key press. I am running the OS v7.0 (series 60 v2.0) emulator.