forked from qt-creator/qt-creator
plug huge memory leak
in my quest to de-virtualize the ProItems i also devirtualized their d'tors without providing a replacement. whoops. Reviewed-by: dt Task-number: QTCREATORBUG-1003
This commit is contained in:
@@ -45,10 +45,13 @@ ProBlock::~ProBlock()
|
||||
{
|
||||
for (ProItem *itm, *nitm = m_proitems; (itm = nitm); ) {
|
||||
nitm = itm->m_next;
|
||||
if (itm->kind() == BlockKind)
|
||||
static_cast<ProBlock *>(itm)->deref();
|
||||
else
|
||||
delete itm;
|
||||
switch (itm->kind()) {
|
||||
case BlockKind: static_cast<ProBlock *>(itm)->deref(); break;
|
||||
case FunctionKind: delete static_cast<ProFunction *>(itm); break;
|
||||
case ConditionKind: delete static_cast<ProCondition *>(itm); break;
|
||||
case OperatorKind: delete static_cast<ProOperator *>(itm); break;
|
||||
case VariableKind: delete static_cast<ProVariable *>(itm); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user