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
This commit is contained in:
Glenn Rice 2010-09-16 02:12:00 +00:00
parent 26ab958ffb
commit b7ba3ffc84

View file

@ -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];