We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 695

Summary: windib video init failes 1st time when using "SDL_WINDOWID" on XP
Product: SDL Reporter: Nomad <wNomad>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 Keywords: target-1.2.14
Version: HG 1.2   
Hardware: x86   
OS: Windows (XP)   

Description Nomad 2009-02-08 10:34:43 UTC
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");
Comment 1 Ryan C. Gordon 2009-09-13 16:33:02 UTC
Tagging this bug with "target-1.2.14" so we can try to resolve it for SDL 1.2.14.

Please note that we may choose to resolve it as WONTFIX. This tag is largely so we have a comprehensive wishlist of bugs to examine for 1.2.14 (and so we can close bugs that we'll never fix, rather than have them live forever in Bugzilla).

--ryan.
Comment 2 Sam Lantinga 2009-09-21 02:54:45 UTC
Thanks, this is fixed in subversion!