From 7a315a303c96859983de5ea2417739496aa043a4 Mon Sep 17 00:00:00 2001 From: "Zane U. Ji" Date: Tue, 29 Oct 2013 19:01:45 +0800 Subject: [PATCH] Fixed a memory leak --- src/xmlcopyeditor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xmlcopyeditor.cpp b/src/xmlcopyeditor.cpp index a13432f..8c80bc1 100644 --- a/src/xmlcopyeditor.cpp +++ b/src/xmlcopyeditor.cpp @@ -2986,7 +2986,7 @@ void MyFrame::OnOpen ( wxCommandEvent& event ) } } - wxFileDialog *fd = new wxFileDialog ( + wxFileDialog fd ( this, ( largeFile ) ? _ ( "Open Large Document" ) : _ ( "Open" ), defaultDir, @@ -3000,11 +3000,11 @@ void MyFrame::OnOpen ( wxCommandEvent& event ) ); - if ( fd->ShowModal() == wxID_CANCEL ) + if ( fd.ShowModal() == wxID_CANCEL ) return; wxArrayString paths; - fd->GetPaths ( paths ); + fd.GetPaths ( paths ); size_t count = paths.Count(); if ( !count ) return;