Link to home
Start Free TrialLog in
Avatar of IssacJones
IssacJones

asked on

Closing an application safely

Hiya

I am doing some checks in the InitInstance of an SDI application. If certain conditions are not met e.g. certain files to be loaded, cannot be found the application needs to shut down. I have done this by using exit(0) whenever I need to close the application.

This works but I tend to get memory leaks and, when I'm using the debugger to check the code, the application closes but it still appears to be in memory in Visual Studio so I have to use Stop Debugging to close it down (even though the application doesn't appear on-screen).

Can anybody give me advice on how to close an SDI application without having these problems?

John
ASKER CERTIFIED SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of IssacJones
IssacJones

ASKER

Cheers Andy!