Fixed memory leaks

This commit is contained in:
Maciej Suminski
2018-12-11 16:21:43 +01:00
parent 7e1498a46f
commit a9efbf4716
11 changed files with 22 additions and 30 deletions
+2 -4
View File
@@ -248,15 +248,13 @@ double RoundTo0( double x, double precision )
}
wxConfigBase* GetNewConfig( const wxString& aProgName )
std::unique_ptr<wxConfigBase> GetNewConfig( const wxString& aProgName )
{
wxConfigBase* cfg = 0;
wxFileName configname;
configname.AssignDir( GetKicadConfigPath() );
configname.SetFullName( aProgName );
cfg = new wxFileConfig( wxT( "" ), wxT( "" ), configname.GetFullPath() );
return cfg;
return std::make_unique<wxConfig>( wxT( "" ), wxT( "" ), configname.GetFullPath() );
}