Ver Fonte

Fixed memory free issues.

woollybah há 10 anos atrás
pai
commit
cabe19e9be
1 ficheiros alterados com 7 adições e 1 exclusões
  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);
 	int ret = SDL_ShowSimpleMessageBox(flags, t, s, NULL);
 	bbMemFree(s);
-	bbMemFree(s);
+	bbMemFree(t);
 	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
     };
 
+	bbMemFree(s);
+	bbMemFree(t);
+
 	int buttonid;
 	SDL_ShowMessageBox(&messageboxdata, &buttonid);
 	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
     };
 
+	bbMemFree(s);
+	bbMemFree(t);
+
 	int buttonid;
 	SDL_ShowMessageBox(&messageboxdata, &buttonid);
 	switch (buttonid) {