Selected original directory when setting a new one

And fixed a memory leak
This commit is contained in:
Zane U. Ji 2013-11-16 23:55:09 +08:00
parent 13b5bb6a87
commit 39613729e9
1 changed files with 4 additions and 3 deletions

View File

@ -293,7 +293,8 @@ void MyPropertySheet::OnOk ( wxCommandEvent& e )
void MyPropertySheet::OnApplicationDirBrowse ( wxCommandEvent& e )
{
wxDirDialog *browseDialog = new wxDirDialog ( this );
if ( browseDialog->ShowModal() == wxID_OK )
applicationDirEdit->SetValue ( browseDialog->GetPath() );
wxDirDialog browseDir ( this );
browseDir.SetPath ( applicationDirEdit->GetValue() );
if ( browseDir.ShowModal() == wxID_OK )
applicationDirEdit->SetValue ( browseDir.GetPath() );
}