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

Author Topic: Handle leak  (Read 2197 times)

0 Members and 1 Guest are viewing this topic.

jsalo

  • Newbie
  • *
  • Posts: 1
    • View Profile
Handle leak
« 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

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Handle leak
« Reply #1 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?
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

 

anything