Skip to content

Commit

Permalink
Fixed bug #695
Browse files Browse the repository at this point in the history
 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");
  • Loading branch information
slouken committed Sep 21, 2009
1 parent d421202 commit f585ecc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/video/windib/SDL_dibevents.c
Expand Up @@ -653,10 +653,11 @@ static SDL_keysym *TranslateKey(WPARAM vkey, UINT scancode, SDL_keysym *keysym,

int DIB_CreateWindow(_THIS)
{
char *windowid = SDL_getenv("SDL_WINDOWID");
char *windowid;

SDL_RegisterApp(NULL, 0, 0);

windowid = SDL_getenv("SDL_WINDOWID");
SDL_windowid = (windowid != NULL);
if ( SDL_windowid ) {
#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
Expand Down

0 comments on commit f585ecc

Please sign in to comment.