mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-21 21:41:09 +00: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,
|
wxFD_OPEN | wxFD_PREVIEW | wxFD_FILE_MUST_EXIST,
|
||||||
this);
|
this);
|
||||||
|
|
||||||
bool fileChosen = !path.IsEmpty();
|
|
||||||
|
|
||||||
std::string currentDir2 = File::GetCurrentDir();
|
std::string currentDir2 = File::GetCurrentDir();
|
||||||
|
|
||||||
if (currentDir != currentDir2)
|
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());
|
File::SetCurrentDir(currentDir.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (path.IsEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
// Should we boot a new game or just change the disc?
|
// Should we boot a new game or just change the disc?
|
||||||
if (Boot)
|
if (Boot)
|
||||||
{
|
|
||||||
if (!fileChosen)
|
|
||||||
return;
|
|
||||||
BootGame(std::string(path.mb_str()));
|
BootGame(std::string(path.mb_str()));
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char newDiscpath[2048];
|
char newDiscpath[2048];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user