Mercurial > sdl-ios-xcode
comparison src/video/windib/SDL_dibevents.c @ 4219:0a7481888fd1 SDL-1.2
Fixed bug #695
Nomad 2009-02-08 10:34:43 PST
The 2nd init is good.
The problem is in "SDL_dibevents.c"
in DIB_CreateWindow()
in SVN:
{
char *windowid = SDL_getenv("SDL_WINDOWID");
SDL_RegisterApp(NULL, 0, 0);
... using of data to which windowid is points
problem:
SDL_RegisterApp() may call SDL_getenv() and windowid will point to some
wrong string
solve:
char *windowid;
SDL_RegisterApp(NULL, 0, 0);
windowid = SDL_getenv("SDL_WINDOWID");
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 21 Sep 2009 09:54:33 +0000 |
parents | d7294b7c732d |
children | cf958451fd8d |
comparison
equal
deleted
inserted
replaced
4218:50b4ab8f8271 | 4219:0a7481888fd1 |
---|---|
651 return(keysym); | 651 return(keysym); |
652 } | 652 } |
653 | 653 |
654 int DIB_CreateWindow(_THIS) | 654 int DIB_CreateWindow(_THIS) |
655 { | 655 { |
656 char *windowid = SDL_getenv("SDL_WINDOWID"); | 656 char *windowid; |
657 | 657 |
658 SDL_RegisterApp(NULL, 0, 0); | 658 SDL_RegisterApp(NULL, 0, 0); |
659 | 659 |
660 windowid = SDL_getenv("SDL_WINDOWID"); | |
660 SDL_windowid = (windowid != NULL); | 661 SDL_windowid = (windowid != NULL); |
661 if ( SDL_windowid ) { | 662 if ( SDL_windowid ) { |
662 #if defined(_WIN32_WCE) && (_WIN32_WCE < 300) | 663 #if defined(_WIN32_WCE) && (_WIN32_WCE < 300) |
663 /* wince 2.1 does not have strtol */ | 664 /* wince 2.1 does not have strtol */ |
664 wchar_t *windowid_t = SDL_malloc((SDL_strlen(windowid) + 1) * sizeof(wchar_t)); | 665 wchar_t *windowid_t = SDL_malloc((SDL_strlen(windowid) + 1) * sizeof(wchar_t)); |