SFML community forums

Help => Window => Topic started by: jsalo on January 13, 2017, 08:56:37 am

Title: Handle leak
Post by: jsalo on January 13, 2017, 08:56:37 am
I noticed this handle count increasing while working on one of my projects. At first I tried to find out if this is something I did wrong. Went back to test and I'm running this minimalistic code right now and the handle count is still increasing constantly.

#include <Windows.h>
#include <SFML\Window.hpp>

int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int nCmdShow)
{
        sf::Window window(sf::VideoMode(800, 600), "My window");

        // run the program as long as the window is open
        while (window.isOpen())
        {
                // check all the window's events that were triggered since the last iteration of the loop
                sf::Event event;
                while (window.pollEvent(event))
                {
                        // "close requested" event: we close the window
                        if (event.type == sf::Event::Closed)
                                window.close();
                }
        }

        return 0;
}
 

Tested with vc12 and vc14 latest 2.4.1 version.
Any clue what's going on here? I let the program run all the way up to 40K Handles and it never stopped climbing.

Short video, Windows Task Manager
https://www.youtube.com/watch?v=ExOe6FXkx00
Title: Re: Handle leak
Post by: Hapax on January 15, 2017, 02:16:31 pm
I just tested this (VC14, SFML 2.4.1) and got a pretty solid 168 handles. How long did you leave it for it to reach so many?