From b7ba3ffc8487c9184ea7604ee6ab5af5f085dfa6 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Thu, 16 Sep 2010 02:12:00 +0000 Subject: [PATCH] Fix a segmentation fault if "Change Disc..." is selected and then the file chooser is cancelled. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6208 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DolphinWX/Src/FrameTools.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index f64be6e570..4494d02b72 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -590,24 +590,21 @@ void CFrame::DoOpen(bool Boot) wxFD_OPEN | wxFD_PREVIEW | wxFD_FILE_MUST_EXIST, this); - bool fileChosen = !path.IsEmpty(); - std::string currentDir2 = File::GetCurrentDir(); if (currentDir != currentDir2) { - PanicAlert("Current dir changed from %s to %s after wxFileSelector!",currentDir.c_str(),currentDir2.c_str()); + PanicAlert("Current dir changed from %s to %s after wxFileSelector!", + currentDir.c_str(), currentDir2.c_str()); File::SetCurrentDir(currentDir.c_str()); } + if (path.IsEmpty()) + return; // Should we boot a new game or just change the disc? if (Boot) - { - if (!fileChosen) - return; BootGame(std::string(path.mb_str())); - } else { char newDiscpath[2048];