Browse Source

Fixed memory free issues.

woollybah 10 years ago
parent
commit
cabe19e9be
1 changed files with 7 additions and 1 deletions
  1. 7 1
      sdlsystem.mod/glue.c

+ 7 - 1
sdlsystem.mod/glue.c

@@ -333,7 +333,7 @@ int bmx_SDL_ShowSimpleMessageBox(BBString * text, BBString * appTitle, int serio
 	char * s = bbStringToUTF8String(text);
 	char * s = bbStringToUTF8String(text);
 	int ret = SDL_ShowSimpleMessageBox(flags, t, s, NULL);
 	int ret = SDL_ShowSimpleMessageBox(flags, t, s, NULL);
 	bbMemFree(s);
 	bbMemFree(s);
-	bbMemFree(s);
+	bbMemFree(t);
 	return ret;
 	return ret;
 }
 }
 
 
@@ -352,6 +352,9 @@ int bmx_SDL_ShowMessageBox_confirm(BBString * text, BBString * appTitle, int ser
         NULL, t, s, SDL_arraysize(buttons), buttons, NULL
         NULL, t, s, SDL_arraysize(buttons), buttons, NULL
     };
     };
 
 
+	bbMemFree(s);
+	bbMemFree(t);
+
 	int buttonid;
 	int buttonid;
 	SDL_ShowMessageBox(&messageboxdata, &buttonid);
 	SDL_ShowMessageBox(&messageboxdata, &buttonid);
 	if (buttonid == 1) {
 	if (buttonid == 1) {
@@ -377,6 +380,9 @@ int bmx_SDL_ShowMessageBox_proceed(BBString * text, BBString * appTitle, int ser
         NULL, t, s, SDL_arraysize(buttons), buttons, NULL
         NULL, t, s, SDL_arraysize(buttons), buttons, NULL
     };
     };
 
 
+	bbMemFree(s);
+	bbMemFree(t);
+
 	int buttonid;
 	int buttonid;
 	SDL_ShowMessageBox(&messageboxdata, &buttonid);
 	SDL_ShowMessageBox(&messageboxdata, &buttonid);
 	switch (buttonid) {
 	switch (buttonid) {