Infinite loop between functions: CandidateHeap::clear() and TreeBuilderExtMem::~TreeBuilderExtMem(); causing a stack overflow.
The problem can be seen in:
CandidateHeap::clear(): line 168
if (this->tb!=NULL){
delete this->tb;
tb = NULL;
}
TreeBuilderExtMem::~TreeBuilderExtMem(): line 93
if (candHeapList!=NULL){
for (int i=0;i<(signed)this->candHeapList->size();i++)
if (this->candHeapList->at(i)!=NULL)
this->candHeapList->at(i)->clear();
this->candHeapList->clear();
}
The bug is caused because both classes have objects of the other class that need to be deleted whenever one of them is deleted.
Infinite loop between functions: CandidateHeap::clear() and TreeBuilderExtMem::~TreeBuilderExtMem(); causing a stack overflow.
The problem can be seen in: CandidateHeap::clear(): line 168 if (this->tb!=NULL){ delete this->tb; tb = NULL; }
TreeBuilderExtMem::~TreeBuilderExtMem(): line 93 if (candHeapList!=NULL){ for (int i=0;i<(signed)this->candHeapList->size();i++) if (this->candHeapList->at(i)!=NULL) this->candHeapList->at(i)->clear(); this->candHeapList->clear(); }
The bug is caused because both classes have objects of the other class that need to be deleted whenever one of them is deleted.