From 39613729e9c6d57b4126cb85898c11e263af724b Mon Sep 17 00:00:00 2001 From: "Zane U. Ji" Date: Sat, 16 Nov 2013 23:55:09 +0800 Subject: [PATCH] Selected original directory when setting a new one And fixed a memory leak --- src/mypropertysheet.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mypropertysheet.cpp b/src/mypropertysheet.cpp index 3693bf1..2c02471 100644 --- a/src/mypropertysheet.cpp +++ b/src/mypropertysheet.cpp @@ -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() ); }