comparison src/SDL_compat.c @ 2037:6bb97f41ab4b

Fixed bug #329 On tracing it turns out to fail from SDL_WM_SetCaption() On going through the function it looks like the SDL_free() function is called every alternate time with an invalid pointer that has already been freed.
author Sam Lantinga <slouken@libsdl.org>
date Sat, 23 Sep 2006 22:51:37 +0000
parents 8055185ae4ed
children 38148947fdcf
comparison
equal deleted inserted replaced
2036:12ef90a41631 2037:6bb97f41ab4b
690 void 690 void
691 SDL_WM_SetCaption(const char *title, const char *icon) 691 SDL_WM_SetCaption(const char *title, const char *icon)
692 { 692 {
693 if (wm_title) { 693 if (wm_title) {
694 SDL_free(wm_title); 694 SDL_free(wm_title);
695 }
696 if (title) {
697 wm_title = SDL_strdup(title);
695 } else { 698 } else {
696 wm_title = SDL_strdup(title); 699 wm_title = NULL;
697 } 700 }
698 SDL_SetWindowTitle(SDL_VideoWindow, wm_title); 701 SDL_SetWindowTitle(SDL_VideoWindow, wm_title);
699 } 702 }
700 703
701 void 704 void
702 SDL_WM_GetCaption(char **title, char **icon) 705 SDL_WM_GetCaption(const char **title, const char **icon)
703 { 706 {
704 if (title) { 707 if (title) {
705 *title = wm_title; 708 *title = wm_title;
706 } 709 }
707 if (icon) { 710 if (icon) {