Actually ensure we cleanup in case of failure in dialog_page_settings

This commit is contained in:
Marek Roszko 2021-05-01 14:14:57 -04:00
parent d4bb1cbc63
commit 6b03b26364
1 changed files with 2 additions and 2 deletions

View File

@ -806,7 +806,7 @@ void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event )
shortFileName = fileName;
}
DS_DATA_MODEL* ws = new DS_DATA_MODEL;
std::unique_ptr<DS_DATA_MODEL> ws = std::make_unique<DS_DATA_MODEL>();
if( ws->LoadDrawingSheet( fileName ) )
{
@ -815,7 +815,7 @@ void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event )
delete m_drawingSheet;
}
m_drawingSheet = ws;
m_drawingSheet = ws.release();
SetWksFileName( shortFileName );