Clean up worksheet draw items

Fixes https://gitlab.com/kicad/code/kicad/-/issues/3882
This commit is contained in:
Jon Evans 2020-07-03 23:06:37 -04:00
parent d143e14694
commit a02a4ff179
2 changed files with 8 additions and 1 deletions

View File

@ -73,6 +73,13 @@ WS_DATA_ITEM::WS_DATA_ITEM( WS_ITEM_TYPE aType )
}
WS_DATA_ITEM::~WS_DATA_ITEM()
{
for( WS_DRAW_ITEM_BASE* item : m_drawItems )
delete item;
}
void WS_DATA_ITEM::SyncDrawItems( WS_DRAW_ITEM_LIST* aCollector, KIGFX::VIEW* aView )
{
int pensize = GetPenSizeUi();

View File

@ -123,7 +123,7 @@ public:
public:
WS_DATA_ITEM( WS_ITEM_TYPE aType );
virtual ~WS_DATA_ITEM() {}
virtual ~WS_DATA_ITEM();
const std::vector<WS_DRAW_ITEM_BASE*>& GetDrawItems() const { return m_drawItems; }