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

Author Topic: SFML 2.0 game on Visual-Studio 2012 doesn't kill the proocess when closing.  (Read 2367 times)

0 Members and 1 Guest are viewing this topic.

Octav23

  • Newbie
  • *
  • Posts: 24
    • View Profile
I've compiled SFML from the latest snapshot as soon as I got Visual Studio 2012, more specifically I used video for help, did exactly every step in the video.

The games run fine, no errors, except I noticed the latest snapshot has no getDefaultFont() which was really handy, but it was no problem, I fixed it easily. Now the problem is, even after calling the close() method, the process can still be seen running in the process explorer window, even if the window of the game is closed. This makes me unable to run the game again without getting an error, and I am forced to waste time and close the process MANUALLY every time I compile again, not to mention I can't actually release any games that hang in the memory after the game is closed.

Now this isn't my code, I tried compiling the example code from the website, it runs PERFECT but the process still hangs after closing the window, I'm almost 100% sure it's the IDE. What can I do to fix this?

Also no, I am not running any multi-threaded games, I am certain, I tried re-building, re-setting a new project with new settings, I am using windows 7 and Visual Studio 2012.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11008
    • View Profile
    • development blog
    • Email
Well closing the window, doesn't close the application, it ehrm just closes the window. ;)

But of course if you'd do something like:
while(window.isOpen())
    window.close();

Then the while loop should get exited.
Now I don't really know what your exactly doing. With VS you should be able to simply press the stop button, so the manual way wouldn't be that bad.

I've compiled SFML from the latest snapshot as soon as I got Visual Studio 2012, more specifically I used this video for help, did exactly every step in the video.
I can only suggest to follow strictly the official tutorials rather than following some video tutorials on youtube.

except I noticed the latest snapshot has no getDefaultFont() which was really handy, but it was no problem,
Yes it was removed for licensing issues and to fix other reoccurring problems.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Octav23

  • Newbie
  • *
  • Posts: 24
    • View Profile
Well closing the window, doesn't close the application, it ehrm just closes the window. ;)

But of course if you'd do something like:
while(window.isOpen())
    window.close();

Then the while loop should get exited.
Now I don't really know what your exactly doing. With VS you should be able to simply press the stop button, so the manual way wouldn't be that bad.

I've compiled SFML from the latest snapshot as soon as I got Visual Studio 2012, more specifically I used this video for help, did exactly every step in the video.
I can only suggest to follow strictly the official tutorials rather than following some video tutorials on youtube.

except I noticed the latest snapshot has no getDefaultFont() which was really handy, but it was no problem,
Yes it was removed for licensing issues and to fix other reoccurring problems.
I don't understand. How else am I supposed to close the game other than window.close()? I've ran this game on visual studio 2010, codeblocks and many other IDEs, it works fine, not to mention the official example still does it. It's not the code, it's the IDE. I followed a video from a user because there's no official tutorial for visual studio 2012, just 2008 and 2010. Also there is no stop button since I'm running the game without debugging it like I always have.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11008
    • View Profile
    • development blog
    • Email
Don't make full quotes, it only makes the whole thread way too long and doesn't serve any purpose. If you related to the full reply then just write another reply without quote, the connection will be obvious. If you want to relate to some parts of the written text, then you can quote that part.

I don't understand. How else am I supposed to close the game other than window.close()?
As I said it all depends on how you work with it, but whether your application is running or not is not directly connected to the window.
int main()
{
    // The application starts here

    // Do whatever you want here

    // The application ends here
}
So you can for instance not create a window at all and your application will still run. Or you could not close the window and at the application end it will close itself automatically (since SFML was written that way).

I followed a video from a user because there's no official tutorial for visual studio 2012, just 2008 and 2010.
All the different versions of Visual Studio are the same for settings things up, the most noticeable difference is the design change and the most important changes are all under the hood.
Besides that, although I haven't seen the whole video, I can already tell you that he does things not the way one should do it. E.g. deleting BUILD_ALL and INSTALL doesn't help at all and removes the way better way to build the library, by just building the INSTALL project and let CMake/VS put the files cleaned up into one directory.

Also there is no stop button since I'm running the game without debugging it like I always have.
If you're developing you should always run it through the debugger (in debug mode) so you'll be able to step in at any point in time and catch crashes faster.
For your problem run it in the debugger and when it should finish, click the pause button and see where the application is hanging or if you even get an error.[/code]
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything