| Summary: | DX5_CreateWindow fails when some environment variable set | ||
|---|---|---|---|
| Product: | SDL | Reporter: | dave <davelv> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED ENDOFLIFE | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | davelv |
| Version: | 1.2.15 | ||
| Hardware: | x86 | ||
| OS: | Windows (All) | ||
File: src/video/Windx5/SDL_dx5events.c Line: 934 Function: int DX5_CreateWindow(_THIS) Hello, and sorry if you're getting several copies of this message by email, since we are closing many bugs at once here. We have decided to mark all SDL 1.2-related bugs as RESOLVED ENDOFLIFE, as we don't intend to work on SDL 1.2 any further, but didn't want to mark a large quantity of bugs as RESOLVED WONTFIX, to clearly show what was left unattended to and make it easily searchable. Our current focus is on SDL 2.0. If you are still having problems with an ENDOFLIFE bug, your absolute best option is to move your program to SDL2, as it will likely fix the problem by default, and give you access to modern platforms and tons of super-cool new features. Failing that, we _will_ accept small patches to fix these issues, and put them in revision control, although we do not intend to do any further official 1.2 releases. Failing that, please feel free to contact me directly by email (icculus@icculus.org) and we'll try to find some way to help you out of your situation. Thank you, --ryan. |
DX5_CreateWindow fails when some ENVIRONMENT-VAR set CODE: int DX5_CreateWindow(_THIS) { char *windowid = SDL_getenv("SDL_WINDOWID"); /* some code*/ SDL_RegisterApp(NULL, 0, 0); SDL_windowid = (windowid != NULL); /* some code*/ } SDL_RegisterApp() CALL SDL_iconv_utf8_ucs2()/SDL_iconv_utf8_locale() CALL SDL_iconv_string() CALL SDL_iconv_open() CALL getlocale() CALL SDL_getenv() The function SDL_getenv use static memory to store envars, but the DX5_CreateWindow use this memory crossed. When LC_CTYPE/LC_MESSAGES/LANG has set and LC_ALL not set, the static memory while be covered by new value after call SDL_RegisterApp(). The static storage which was pointed by windowid must be copied to new memory before call SDL_RegisterApp().