changeset 1068:624696318b5b

Fix a memory corruption bug from failing to grow the buffer for the window caption when switching games
author Michael Pavone <pavone@retrodev.com>
date Fri, 05 Aug 2016 22:24:43 -0700
parents 96db3e289ed1
children dc05e3a7d8da
files render_sdl.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/render_sdl.c	Fri Aug 05 22:24:36 2016 -0700
+++ b/render_sdl.c	Fri Aug 05 22:24:43 2016 -0700
@@ -234,6 +234,7 @@
 }
 
 char * caption = NULL;
+char * fps_caption = NULL;
 
 static void render_quit()
 {
@@ -412,6 +413,8 @@
 void render_update_caption(char *title)
 {
 	caption = title;
+	free(fps_caption);
+	fps_caption = NULL;
 }
 
 void render_context(vdp_context * context)
@@ -715,8 +718,6 @@
 	return 0;
 }
 
-char * fps_caption = NULL;
-
 uint32_t frame_counter = 0;
 uint32_t start = 0;
 #ifdef __ANDROID__