Fixed ISOProperties window crash. Please don't kill modals with Destroy() but with EndModal().

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2020 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY 2009-01-28 10:21:18 +00:00
parent ac80c04eab
commit 7bc798b7f1
2 changed files with 7 additions and 7 deletions

View File

@ -644,8 +644,7 @@ void CGameListCtrl::OnProperties(wxCommandEvent& WXUNUSED (event))
if (!iso)
return;
CISOProperties ISOProperties(iso->GetFileName(), this);
ISOProperties.ShowModal();
if (ISOProperties.bRefreshList)
if(ISOProperties.ShowModal() == wxID_OK)
Update();
}

View File

@ -54,14 +54,15 @@ END_EVENT_TABLE()
CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style)
: wxDialog(parent, id, title, position, size, style)
{
OpenISO = DiscIO::CreateVolumeFromFilename(fileName);
OpenISO = DiscIO::CreateVolumeFromFilename(fileName);
pFileSystem = DiscIO::CreateFileSystem(OpenISO);
pFileSystem->GetFileList(Our_Files);
GameListItem OpenISO_(fileName);
bRefreshList = false;
bRefreshList = false;
CreateGUIControls();
GameIniFile = FULL_GAMECONFIG_DIR + (OpenISO->GetUniqueID()) + ".ini";
@ -409,7 +410,7 @@ void CISOProperties::OnClose(wxCloseEvent& WXUNUSED (event))
if (!SaveGameConfig())
wxMessageBox(wxString::Format(_("Could not save %s"), GameIniFile.c_str()), _("Error"), wxOK|wxICON_ERROR, this);
Destroy();
EndModal(bRefreshList ? wxID_OK : wxID_CANCEL);
}
void CISOProperties::OnCloseClick(wxCommandEvent& WXUNUSED (event))
@ -492,7 +493,7 @@ void CISOProperties::OnExtractDir(wxCommandEvent& WXUNUSED (event))
void CISOProperties::SetRefresh(wxCommandEvent& WXUNUSED (event))
{
bRefreshList = true;
bRefreshList = true;
}
void CISOProperties::LoadGameConfig()
@ -529,7 +530,7 @@ void CISOProperties::LoadGameConfig()
if (iTemp == -1)
{
iTemp = 0;
bRefreshList = true;
bRefreshList = true;
}
EmuState->SetSelection(iTemp);