diff --git a/common/dialogs/dialog_page_settings.cpp b/common/dialogs/dialog_page_settings.cpp index 2e8fd0e86d..28bbab9149 100644 --- a/common/dialogs/dialog_page_settings.cpp +++ b/common/dialogs/dialog_page_settings.cpp @@ -806,7 +806,7 @@ void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event ) shortFileName = fileName; } - DS_DATA_MODEL* ws = new DS_DATA_MODEL; + std::unique_ptr ws = std::make_unique(); 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 );