Fix resources leak reported by coverity

For unique_ptr, release only set the ownership to null, but don't free the resource behind. On the other hand, reset do. 

Closes Coverity ID 483269
Closes Coverity ID 471974
Closes Coverity ID 471973
This commit is contained in:
Lucas Dumont 2024-02-09 23:17:24 +01:00 committed by Jon Evans
parent c76c4ba304
commit 13c647ef6f
3 changed files with 3 additions and 3 deletions

View File

@ -62,7 +62,7 @@ void FP_LIB_TABLE_ROW::SetType( const wxString& aType )
if( PCB_IO_MGR::PCB_FILE_T( -1 ) == type )
type = PCB_IO_MGR::KICAD_SEXP;
plugin.release();
plugin.reset();
}

View File

@ -344,7 +344,7 @@ void SCH_IO_HTTP_LIB::connect()
m_lastError = m_conn->GetLastError();
// Make sure we release pointer so we are able to query API again next time
m_conn.release();
m_conn.reset();
return;
}

View File

@ -73,7 +73,7 @@ void SYMBOL_LIB_TABLE_ROW::SetType( const wxString& aType )
if( type == SCH_IO_MGR::SCH_FILE_UNKNOWN )
type = SCH_IO_MGR::SCH_KICAD;
plugin.release();
plugin.reset();
}