From 3d546d8487820d04ea1af1a7da7e1d43b40552bc Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Fri, 5 Aug 2016 22:24:43 -0700 Subject: Fix a memory corruption bug from failing to grow the buffer for the window caption when switching games --- render_sdl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'render_sdl.c') diff --git a/render_sdl.c b/render_sdl.c index dcd6ffc..5d9072a 100755 --- a/render_sdl.c +++ b/render_sdl.c @@ -234,6 +234,7 @@ void render_free_surfaces(vdp_context *context) } char * caption = NULL; +char * fps_caption = NULL; static void render_quit() { @@ -412,6 +413,8 @@ void render_init(int width, int height, char * title, uint32_t fps, uint8_t full void render_update_caption(char *title) { caption = title; + free(fps_caption); + fps_caption = NULL; } void render_context(vdp_context * context) @@ -715,8 +718,6 @@ int32_t handle_event(SDL_Event *event) return 0; } -char * fps_caption = NULL; - uint32_t frame_counter = 0; uint32_t start = 0; #ifdef __ANDROID__ -- cgit v1.2.3