mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 13:57:57 -07:00
Made opening the ISO file more safe, so it doesn't seg fault when it can't find the filetype from extension and etc.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1469 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
0e47a7986d
commit
05d2e470bf
@ -585,7 +585,18 @@ void CISOProperties::OnEditConfig(wxCommandEvent& WXUNUSED (event))
|
||||
SaveGameConfig();
|
||||
|
||||
wxFileType* filetype = wxTheMimeTypesManager->GetFileTypeFromExtension(_("ini"));
|
||||
wxExecute(filetype->GetOpenCommand(wxString::FromAscii(GameIniFile.c_str())), wxEXEC_SYNC);
|
||||
if(filetype == NULL)
|
||||
{
|
||||
PanicAlert("Filetype 'ini' is unknown! Will not open!");
|
||||
return;
|
||||
}
|
||||
wxString OpenCommand;
|
||||
OpenCommand = filetype->GetOpenCommand(wxString::FromAscii(GameIniFile.c_str()));
|
||||
if(OpenCommand.IsEmpty())
|
||||
PanicAlert("Couldn't find open command for extension 'ini'!");
|
||||
else
|
||||
if(wxExecute(OpenCommand, wxEXEC_SYNC) == -1)
|
||||
PanicAlert("wxExecute returned -1 on application run!");
|
||||
|
||||
GameIni.Load(GameIniFile.c_str());
|
||||
LoadGameConfig();
|
||||
|
Loading…
Reference in New Issue
Block a user