SFML community forums

Help => Graphics => Topic started by: N1ghtly on December 22, 2012, 04:12:11 pm

Title: SIGSEGV Fault on exiting
Post by: N1ghtly on December 22, 2012, 04:12:11 pm
When I (deliberately) terminate my program, it exits with a SIGSEGV fault. This occurs only when I run the debug build though, the release build exits just fine. When I used the debugger, the fault occured on line 95 in Texture.cpp.

Texture::~Texture()
{
    // Destroy the OpenGL texture
    if (m_texture)
    {
        ensureGlContext();

        GLuint texture = static_cast<GLuint>(m_texture);
        glCheck(glDeleteTextures(1, &texture)); //line 95
    }
}

I only use ONE texture in my program and it is not dynamically allocated so I don't see what I'm doing wrong here...
Title: Re: SIGSEGV Fault on exiting
Post by: eXpl0it3r on December 22, 2012, 05:00:16 pm
You're probably not doing anything wrong... SFML is known to have problems with the correct destruction of its global context/resources and I'm not sure what can be done.
Title: Re: SIGSEGV Fault on exiting
Post by: N1ghtly on December 22, 2012, 05:13:28 pm
Oh... Is that going to be fixed in SFML 2?
I'm using the release candidate atm.
Title: Re: SIGSEGV Fault on exiting
Post by: eXpl0it3r on December 22, 2012, 05:22:31 pm
SFML will also have a global context etc, but the problem you ran into might already be fixed in the newest commit on GitHub. So you might want to build SFML on your own (or use my Nightly Builds posted on the forum).
Title: Re: SIGSEGV Fault on exiting
Post by: Laurent on December 22, 2012, 06:31:24 pm
Quote
When I (deliberately) terminate my program
How? If it's by closing the console, then it's the expected behaviour. Otherwise you'll have to provide more information, because this is not supposed to happen.
Title: Re: SIGSEGV Fault on exiting
Post by: N1ghtly on December 22, 2012, 09:01:18 pm
Simply by clicking the exit button.
window.close() is called and the program finishes.
Keep in mind I never dynamically allocated a single texture so all deleting is automatically...
Title: Re: SIGSEGV Fault on exiting
Post by: Laurent on December 22, 2012, 10:46:39 pm
Can you show a complete and minimal code that reproduces the problem?