Archived

This topic is now archived and is closed to further replies.

why is my program stayin in memory??????????

This topic is 6116 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i compiled my win32 program and exited it as usual i pressed alt-ctrl-del and found that the program was still lingering there wat can i do so that it doesnt stay there and freeze? thanx

Share this post


Link to post
Share on other sites
Usually, that doesn''t happen. Tell us more about the program.
Make the program show a MessageBox just before the exit. Perhaps it doesnt reach the exit point at all.
Restart your computer. Windows does strange stuff at times.

Share this post


Link to post
Share on other sites
i did put a message box
i checked the code over but i cant find anything that would keep it from going away

im gonna try restarting my computer

Share this post


Link to post
Share on other sites
Ok i think i might know where the problem is since the same thing used to happen to me.

If you have a main loop in your app that looks something like this:

while (Running)
{
...
DoStuff();
RenderStuff();
...
}

What happens is, if you call PostQuitMessage(0)when quiting, the window is destoyed but the main loop will still be running in the background (explaining why it is still there when you press alt+ctrl+del). So make sure whenever you want to quit, first break out of your main loop (eg by saying Running=false), and then use the PostQuitMessage(0)

Hope that helps

Share this post


Link to post
Share on other sites