mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 07:21:14 +01:00
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:
parent
26ab958ffb
commit
b7ba3ffc84
@ -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];
|
||||
|
Loading…
x
Reference in New Issue
Block a user