[SDL] Problem to destroy window with SDL 1.3

cyrille herlem bubkadk at hotmail.com
Mon Jul 25 09:12:14 PDT 2011


Hi everybody,

I wrote the following source code and I have a problem to destroy SDL objects.

{
          if (SDL_Init(SDL_INIT_VIDEO) != 0) {
        printf("Error initializing SDL:  %s\n", SDL_GetError());
     }
        windowId=SDL_CreateWindowFrom((void*)widget->winId());
        if(windowId == 0) {
        qDebug()<<SDL_GetError();
    }

    renderer=SDL_CreateRenderer(windowId ,-1,0);

    if (!renderer) {
        qDebug()<<SDL_GetError();
    }

    /* Loop, waiting for QUIT or the escape key */

    SDL_RenderClear(renderer);
    SDL_SetRenderDrawColor(renderer,255,255,255,0);
    SDL_RenderPresent(renderer);
    //    SDL_DestroyRenderer(renderer);

    SDL_DestroyRenderer(renderer);
    SDL_DestroyWindow(windowId);

    SDL_Quit();
}

when I run it in Debug mode, i get the following message:

Program received signal SIGSEGV, Segmentation fault.
IME_HandleMessage (hwnd=0x1b07b4, msg=70, wParam=0, lParam=0x28cbc4, 
    videodata=0x0) at src/video/windows/SDL_windowskeyboard.c:837
837         if (!videodata->ime_initialized || !videodata->ime_available || !videodata->ime_enabled)
Current language:  auto; currently c
(gdb) Error: dll starting at 0x77510000 not found.
Error: dll starting at 0x76900000 not found.
Error: dll starting at 0x77510000 not found.
Error: dll starting at 0x77630000 not found.

This error appears only when SDL_DestroyWindow(windowId) or SDL_Quit()are called.

if I replace
 windowId=SDL_CreateWindowFrom((void*)widget->winId());
by
 windowId = SDL_CreateWindow=SDL_CreateWindow("Example",SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,512, 384, SDL_WINDOW_SHOWN);
the error no longer appears


Could you help me to find the cause of this error ? 

Thanks a lot

Cyrille Herlem





 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110725/bd489eee/attachment-0007.htm>


More information about the SDL mailing list