From b68b198070c315683039c51ff2eb4231af7c2d12 Mon Sep 17 00:00:00 2001 From: bladeoner Date: Wed, 15 Mar 2023 17:28:09 +0100 Subject: [PATCH] Snes9x - Make S9xSetInfoString own its string. (#1054) --- source/snes9x/gfx.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/snes9x/gfx.cpp b/source/snes9x/gfx.cpp index 2097e78..b8ca0e7 100644 --- a/source/snes9x/gfx.cpp +++ b/source/snes9x/gfx.cpp @@ -1760,9 +1760,12 @@ void S9xReRefresh (void) void S9xSetInfoString (const char *string) { + static std::string info_string; + if (Settings.InitialInfoStringTimeout > 0) { - GFX.InfoString = string; + info_string = string; + GFX.InfoString = info_string.c_str(); GFX.InfoStringTimeout = Settings.InitialInfoStringTimeout; S9xReRefresh(); }