SFML community forums

Help => Window => Topic started by: techspy007 on June 16, 2016, 05:48:42 pm

Title: sfml window memory access error on exit
Post by: techspy007 on June 16, 2016, 05:48:42 pm
The sfml window seems to have a bug. A blank window without any content runs and exits fine. Drawing anything in the window causes a memory access violation on exit.

This also occurs when running the examples that come bundled with sfml win32 latest stable release from the sfml site.

Other posts claim similar problems but none of them mention that the examples also cause this.
Title: Re: sfml window memory access error on exit
Post by: eXpl0it3r on June 16, 2016, 06:02:03 pm
Start the debug version in a debugger and retrieve the stack trace. To me it sounds more likely like a GPU driver issue or similar.
Title: Re: sfml window memory access error on exit
Post by: techspy007 on June 16, 2016, 06:37:28 pm
Well I ran the examples on my laptop and they seem to run okay. Both gpu cards are Intel though (all these issues because my gtx died on me on Saturday:(  ), but anyways I'm installing different drivers on the desktop and update.

Update #1:
Changed my driver version, it stil persists. Well I'm stumped now.

The pre-built examples report an unhandled exception at a memory address with ntdll.dll.

Well the stack trace crashes when sfml calls the window destructor. The same happens when i have an OpenGl context and close the window. The call to window.Close() causes a similar exception.

I can thats the last call on the stack.
Title: AW: sfml window memory access error on exit
Post by: eXpl0it3r on June 16, 2016, 09:54:09 pm
What exact version of SFML are you using? Or where did you download it from?
Title: Re: sfml window memory access error on exit
Post by: techspy007 on June 17, 2016, 12:37:03 am
I am using sfml 2.3.2 32 bit windows build downloaded from the sfml website.

I also compiled sfml locally and the error still occurs. It's somehow linked to sfml's opengl context.

Edit:
From the stacktrace, the way the code is structured is such that the app stil tries to draw even after the exit event. I've moved the event handlers to a custom function, cleaned up the opengl resourses and freed memory then used a C++ exception to jump back to main() and exit.

Hopefully my code wont make Bjarne want to slap me.

Anyone wants the actual code just PM me.