summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorGlenn Rice <glennricster@gmail.com>2010-09-16 02:12:00 +0000
committerGlenn Rice <glennricster@gmail.com>2010-09-16 02:12:00 +0000
commitb7ba3ffc8487c9184ea7604ee6ab5af5f085dfa6 (patch)
tree8955762ba7b53eac5341424ce17919ad77d2b25e /Source/Core
parent26ab958ffbbddbbeacb01608ea78550b0189c152 (diff)
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
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinWX/Src/FrameTools.cpp11
1 files 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];