David Carre to Sam
authorSam Lantinga <slouken@libsdl.org>
Tue, 18 Aug 2009 03:26:53 +0000
changeset 323896492d29034a
parent 3237 916f396fe65d
child 3239 ab5aebd50add
David Carre to Sam

When i call the "SDL_Quit()" function, it call the func "SDL_QuitSubSystem(SDL_INIT_EVERYTHING)", which call the "SDL_VideoQuit()" function.

It's where i'm lost, this function "SDL_VideoQuit()" will recall the "SDL_Quit()" function (i don't find where it is called), which in turn recall the "SDL_QuitSubSystem(SDL_INIT_EVERYTHING)", which in turn recall "SDL_VideoQuit()", which cause a "double free" seg fault since it has been already called.

I have set the num_displays to 0 instead of 1, so it wont free it twice in the videoquit function loop.
src/video/pandora/SDL_pandora.c
     1.1 --- a/src/video/pandora/SDL_pandora.c	Tue Aug 11 21:27:19 2009 +0000
     1.2 +++ b/src/video/pandora/SDL_pandora.c	Tue Aug 18 03:26:53 2009 +0000
     1.3 @@ -91,8 +91,8 @@
     1.4  
     1.5  
     1.6      /* Setup amount of available displays and current display */
     1.7 -    device->num_displays = 1;
     1.8 -    device->current_display = 1;
     1.9 +    device->num_displays = 0;
    1.10 +    device->current_display = 0;
    1.11  
    1.12      /* Set device free function */
    1.13      device->free = PND_destroy;
    1.14 @@ -323,6 +323,8 @@
    1.15  void
    1.16  PND_setwindowgrab(_THIS, SDL_Window * window)
    1.17  {
    1.18 +    SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata;
    1.19 +    eglTerminate(phdata->egl_display);
    1.20  }
    1.21  void
    1.22  PND_destroywindow(_THIS, SDL_Window * window)