diff options
author | Michael Pavone <pavone@retrodev.com> | 2016-08-05 22:24:43 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2016-08-05 22:24:43 -0700 |
commit | 3d546d8487820d04ea1af1a7da7e1d43b40552bc (patch) | |
tree | 33ebdf6abba856546c4eb4fb9666c2cd835cd994 | |
parent | c359bd744a0203d4b89ad1ae5bd6cf9984be53c6 (diff) |
Fix a memory corruption bug from failing to grow the buffer for the window caption when switching games
-rwxr-xr-x | render_sdl.c | 5 |
1 files changed, 3 insertions, 2 deletions
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__ |