Closed AngryLawyer closed 11 years ago
Turns out it was an error in my logic. Who'd have thought?!
Thanks, @AngryLawyer.
No problem.
For anyone curious, I had a match statement that tested for the successful creation of an Engine struct, which called sdl::quit at the end of it. As quit was called within the match, Engine never fell out of scope and destroyed its Surfaces until after quit was called, causing the segfault.
When closing an SDL application that has surfaces allocated using the window close button, the application segfaults. I believe this is due to the Drop block being called on all surfaces as they fall out of scope, even though OSX has gone and cleared up the memory itself.
To reproduce:
It might be as simple as checking to see if SDL is initialized before trying to release a surface. I'll provide code to reproduce when I next have a chance.