DRC: Fix a minor memory leak

This commit is contained in:
Jon Evans 2020-12-29 14:05:09 -05:00
parent bc712a7383
commit 241823647b
2 changed files with 12 additions and 4 deletions

View File

@ -36,6 +36,13 @@ std::vector<KICAD_T> DRC_TEST_PROVIDER::s_allBasicItems;
std::vector<KICAD_T> DRC_TEST_PROVIDER::s_allBasicItemsButZones;
DRC_TEST_PROVIDER_REGISTRY::~DRC_TEST_PROVIDER_REGISTRY()
{
for( DRC_TEST_PROVIDER* provider : m_providers )
delete provider;
}
DRC_TEST_PROVIDER::DRC_TEST_PROVIDER() :
m_drcEngine( nullptr )
{
@ -327,4 +334,4 @@ bool DRC_TEST_PROVIDER::isInvisibleText( const BOARD_ITEM* aItem ) const
}
return false;
}
}

View File

@ -37,8 +37,9 @@ class DRC_TEST_PROVIDER;
class DRC_TEST_PROVIDER_REGISTRY
{
public:
DRC_TEST_PROVIDER_REGISTRY() {};
~DRC_TEST_PROVIDER_REGISTRY() {};
DRC_TEST_PROVIDER_REGISTRY() {}
~DRC_TEST_PROVIDER_REGISTRY();
static DRC_TEST_PROVIDER_REGISTRY& Instance()
{
@ -72,7 +73,7 @@ class DRC_TEST_PROVIDER
{
public:
DRC_TEST_PROVIDER ();
virtual ~DRC_TEST_PROVIDER() {}
virtual ~DRC_TEST_PROVIDER() = default;
void SetDRCEngine( DRC_ENGINE *engine )
{