SFML community forums

General => General discussions => Topic started by: keyforge on August 20, 2011, 07:58:39 pm

Title: Runtime error when closing app via console...
Post by: keyforge on August 20, 2011, 07:58:39 pm
Hello everyone, I'm having an issue with an app I wrote. when I close the window through the window's close button, it closes fine with no errors, but when I close the window through the console it gives me a runtime error. Normally I wouldn't care about the console but it makes me weary that there might be a memory leak somewhere. Does anyone know how I could fix this? If you need my code I can give it to you.
Title: Re: Runtime error when closing app via console...
Post by: Nexus on August 20, 2011, 08:02:37 pm
Quote from: "keyforge"
Does anyone know how I could fix this?
Don't close it via console, this terminates the application immediately.
Title: Runtime error when closing app via console...
Post by: keyforge on August 20, 2011, 08:13:51 pm
Alright, so closing it via console will always cause errors? I find it a bad idea to leave in runtime errors and like my apps to be clean. The error comes only when I close it via console in VC++. In previous apps I've written it worked (possibly because I wrote an OO style engine wrapper?)

If there's no way to fix it that's fine, but I'd like to have it fixed just to please myself (please excuse my perfectionism :))
Title: Runtime error when closing app via console...
Post by: Nexus on August 20, 2011, 09:02:53 pm
You can't expect that terminating (in the sense of aborting) a running process results in proper cleanup. Quit the application in a normal way, just like every other user :)

This topic is not specific to SFML, by the way.
Title: Runtime error when closing app via console...
Post by: keyforge on August 20, 2011, 11:35:32 pm
Ok, thank you. And I wasn't sure if it had to do with SFML or not because the problem was gone when removing my SFML window loop.