From b2833cbdbe2e0b097aea0476ca794ef4c221667a Mon Sep 17 00:00:00 2001 From: punkrockguy318 Date: Sat, 16 Jan 2016 18:53:33 +0000 Subject: [PATCH] sdl: sf#719 applying Mika Attila's patch to fix dangling pointers in gui --- trunk/src/drivers/sdl/gui.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/trunk/src/drivers/sdl/gui.cpp b/trunk/src/drivers/sdl/gui.cpp index 9f3c30b5..9f8e9c57 100644 --- a/trunk/src/drivers/sdl/gui.cpp +++ b/trunk/src/drivers/sdl/gui.cpp @@ -1482,9 +1482,9 @@ void recordMovie() { if(isloaded) { - char* movie_fname = const_cast(FCEU_MakeFName(FCEUMKF_MOVIE, 0, 0).c_str()); - FCEUI_printf("Recording movie to %s\n", movie_fname); - FCEUI_SaveMovie(movie_fname, MOVIE_FLAG_NONE, L""); + std::string name = FCEU_MakeFName(FCEUMKF_MOVIE, 0, 0); + FCEUI_printf("Recording movie to %s\n", name.c_str()); + FCEUI_SaveMovie(name.c_str(), MOVIE_FLAG_NONE, L""); } return; @@ -1523,7 +1523,6 @@ void recordMovieAs () fname = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (fileChooser)); if (!fname.size()) return; // no filename selected, quit the whole thing - char* movie_fname = const_cast(FCEU_MakeFName(FCEUMKF_MOVIE, 0, 0).c_str()); std::string s = GetUserText("Author name"); std::wstring author(s.begin(), s.end());