Skip to content
This repository has been archived by the owner. It is now read-only.
Browse files

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.
  • Loading branch information
slouken committed Sep 23, 2006
1 parent 7ad322f commit a759fb0b4999fe6020d9d05140c856f32f146f0c
Showing with 6 additions and 3 deletions.
  1. +1 −1 include/SDL_compat.h
  2. +5 −2 src/SDL_compat.c
@@ -147,7 +147,7 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *
extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title,
const char *icon);
extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon);
extern DECLSPEC void SDLCALL SDL_WM_GetCaption(const char **title, const char **icon);
extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface * icon, Uint8 * mask);
extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void);
extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface * surface);
@@ -692,14 +692,17 @@ SDL_WM_SetCaption(const char *title, const char *icon)
if (wm_title) {
} else {
if (title) {
wm_title = SDL_strdup(title);
} else {
wm_title = NULL;
SDL_SetWindowTitle(SDL_VideoWindow, wm_title);

SDL_WM_GetCaption(char **title, char **icon)
SDL_WM_GetCaption(const char **title, const char **icon)
if (title) {
*title = wm_title;

0 comments on commit a759fb0

Please sign in to comment.