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

Author Topic: process keeps running after Close() is called [solved]  (Read 2320 times)

0 Members and 1 Guest are viewing this topic.

bobasaurus

  • Newbie
  • *
  • Posts: 9
    • View Profile
process keeps running after Close() is called [solved]
« on: August 31, 2010, 04:27:29 am »
If I create a sf::Window object, and then close the window and exit the program, the process/executable still remains in memory for some reason.  I have a basic code example to illustrate my issue:

Code: [Select]
#include <SFML/System.hpp>
#include <SFML/Window.hpp>

int main() {
sf::Window app(sf::VideoMode(800, 600, 32), "SFML Test");

sf::Clock clock;
while (clock.GetElapsedTime() < 5.0f) sf::Sleep(0.5f);

app.Close();

return EXIT_SUCCESS;
}


This will open a blank window then close it five seconds later, but the task manager still shows the process as running indefinitely.   I did notice the following line in the documentation:

Quote
If you have played around a bit with SFML windows, you have probably noticed that clicking the close box will generate a Closed event, but won't destroy the window. This is to allow users to add custom code before doing it (asking for save, etc.), or cancel it. To actually close a window, you must either destroy the sf::Window instance or call its Close() function.


But I do call the Close function (the window appears to 'close'), and the process continues regardless.  This is with Visual C++ Express 2008 on Windows XP with the linker's entry point property set to 'main' (is this part a problem?).  I'm linking in the dynamic libraries, with the SFML_DYNAMIC preprocessor definition set.  I would appreciate any suggestions.

Edit: Solved the problem.  It really was an issue with declaring the 'main' entry point myself.  Linking in sfml_main.lib instead fixes the issue.  Sorry for the confusion.