Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Runtime error when closing app via console...  (Read 2533 times)

0 Members and 1 Guest are viewing this topic.

keyforge

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Runtime error when closing app via console...
« 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.
Need a place to upload your code, files or screenshots? Use SFML Uploads!

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Runtime error when closing app via console...
« Reply #1 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.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

keyforge

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Runtime error when closing app via console...
« Reply #2 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 :))
Need a place to upload your code, files or screenshots? Use SFML Uploads!

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Runtime error when closing app via console...
« Reply #3 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.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

keyforge

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Runtime error when closing app via console...
« Reply #4 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.
Need a place to upload your code, files or screenshots? Use SFML Uploads!

 

anything