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

Author Topic: [Solved] Memory leak in svn; how to make debug libs  (Read 3686 times)

0 Members and 1 Guest are viewing this topic.

Lord Delvin

  • Jr. Member
  • **
  • Posts: 68
    • ICQ Messenger - 166781460
    • View Profile
[Solved] Memory leak in svn; how to make debug libs
« on: June 02, 2008, 10:19:55 am »
I got a leak of about 260k by just creating a RenderWindow on Linux. If you tell me how to do a debug build without completly rewriting the makefiles I can maybe fix it for you.
Thats what valgrind says:
Code: [Select]
==9464== 262,140 bytes in 1 blocks are definitely lost in loss record 119 of 119
==9464==    at 0x4C22FAB: malloc (vg_replace_malloc.c:207)
==9464==    by 0x409C1E1: (within /usr/lib/libGL.so.169.12)
==9464==    by 0x4091037: glXCreateContext (in /usr/lib/libGL.so.169.12)
==9464==    by 0x5037738: sf::priv::WindowImplX11::CreateContext(sf::VideoMode const&, XVisualInfo&, sf::WindowSettings&, XVisualInfo, unsigned long) (in /usr/lib/libsfml-window.so.1)
==9464==    by 0x5038916: sf::priv::WindowImplX11::WindowImplX11() (in /usr/lib/libsfml-window.so.1)
==9464==    by 0x5034D02: sf::priv::WindowImpl::New() (in /usr/lib/libsfml-window.so.1)
==9464==    by 0x50320B4: sf::Window::ForceContextInit() (in /usr/lib/libsfml-window.so.1)
==9464==    by 0x50323C6: sf::Window::Create(sf::VideoMode, std::string const&, unsigned long, sf::WindowSettings const&) (in /usr/lib/libsfml-window.so.1)
==9464==    by 0x528155F: sf::RenderWindow::RenderWindow(sf::VideoMode, std::string const&, unsigned long, sf::WindowSettings const&) (in /usr/lib/libsfml-graphics.so.1)
==9464==    by 0x40F64F: ape::std::sfmlRenderer::sfmlRenderer(unsigned, unsigned, char const*, unsigned) (sfmlRenderer.cpp:9)
==9464==    by 0x402726: main (main.cpp:21)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
[Solved] Memory leak in svn; how to make debug libs
« Reply #1 on: June 02, 2008, 10:37:42 am »
This one is not really a leak, it's just the global OpenGL context that SFML creates to ensure that OpenGL calls can be made before the first window is created. Unfortunately, as a global it can't be safely deleted by the application (however it will be done by the OS).
Laurent Gomila - SFML developer

Lord Delvin

  • Jr. Member
  • **
  • Posts: 68
    • ICQ Messenger - 166781460
    • View Profile
[Solved] Memory leak in svn; how to make debug libs
« Reply #2 on: June 02, 2008, 11:27:42 pm »
Hmm okay.

 

anything