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 ) void MyPropertySheet::OnApplicationDirBrowse ( wxCommandEvent& e )
{ {
wxDirDialog *browseDialog = new wxDirDialog ( this ); wxDirDialog browseDir ( this );
if ( browseDialog->ShowModal() == wxID_OK ) browseDir.SetPath ( applicationDirEdit->GetValue() );
applicationDirEdit->SetValue ( browseDialog->GetPath() ); if ( browseDir.ShowModal() == wxID_OK )
applicationDirEdit->SetValue ( browseDir.GetPath() );
} }