Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualServant of the Lord

Posted 20 March 2013 - 12:25 PM

The callstack is saying that this line is crashing:

myeng::Screen::~Screen()
{
    SDL_FreeSurface(screen_ptr);
}

(I'm guessing that ZN5myeng6ScreenD@Ev() is the mangled name for the myeng::Screen's destructor - but I think it's the correct guess)

 

I had forgotten that the SDL_Surface returned by SDL_SetVideoMode() is not supposed to be freed manually, and is instead freed automaticly by SDL_Quit(), so it's accidentally freeing the same surface twice and crashing. Just remove 'SDL_FreeSurface(screen_ptr);', and it should work fine.


#2Servant of the Lord

Posted 20 March 2013 - 12:24 PM

The callstack is saying that this line is crashing:

myeng::Screen::~Screen()
{
    SDL_FreeSurface(screen_ptr);
}

(I'm guessing that ZN5myeng6ScreenD@Ev() is the mangled name for the myeng::Screen's destructor - but I think it's the correct guess)

 

I had forgotten that the SDL_Surface returned by SDL_SetVideoMode() is not supposed to be freed manually, and is instead freed by SDL_Quit(), so it's accidentally freeing the same surface twice and crashing.


#1Servant of the Lord

Posted 20 March 2013 - 12:23 PM

The callstack is saying that this line is crashing:

 

 

myeng::Screen::~Screen()
{
    SDL_FreeSurface(screen_ptr);
}

 

I had forgotten that the SDL_Surface returned by SDL_SetVideoMode() is not supposed to be freed manually, and is instead freed by SDL_Quit(), so it's accidentally freeing the same surface twice and crashing.


PARTNERS