From f9ade69cb016759d992b73ac66e54ae91c77f749 Mon Sep 17 00:00:00 2001 From: "giwoong.kim" Date: Tue, 14 Aug 2012 16:24:24 +0900 Subject: [PATCH] [Title] added SDL_FreeSurface [Type] bugfix [Module] Emulator / sdl [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- tizen/src/maru_sdl.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tizen/src/maru_sdl.c b/tizen/src/maru_sdl.c index d2e4eb4f36..e31c640ef4 100644 --- a/tizen/src/maru_sdl.c +++ b/tizen/src/maru_sdl.c @@ -94,6 +94,11 @@ void qemu_ds_sdl_resize(DisplayState *ds) pthread_mutex_lock(&sdl_mutex); #endif + if (surface_qemu != NULL) { + SDL_FreeSurface(surface_qemu); + surface_qemu = NULL; + } + /* create surface_qemu */ surface_qemu = SDL_CreateRGBSurfaceFrom(ds_get_data(ds), ds_get_width(ds), @@ -296,6 +301,14 @@ static void qemu_update(void) if (sdl_alteration == 1) { sdl_alteration = 0; _sdl_init(); + + return; + } else if (sdl_alteration == -1) { + SDL_FreeSurface(processing_screen); + SDL_FreeSurface(surface_qemu); + surface_qemu = NULL; + SDL_Quit(); + return; } @@ -486,8 +499,7 @@ void maruskin_sdl_quit(void) glDeleteTextures(1, &texture); } - SDL_FreeSurface(processing_screen); - SDL_Quit(); + sdl_alteration = -1; } -- 2.34.1