Skip to content

Commit

Permalink
BuG: fix leak in modeling widget (internalTable)
Browse files Browse the repository at this point in the history
  • Loading branch information
Punzo committed Aug 3, 2018
1 parent d633d76 commit 1aee1c3
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions AstroModeling/qSlicerAstroModelingModuleWidget.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,6 @@ void qSlicerAstroModelingModuleWidgetPrivate::cleanPointers()
}
this->parametersNode = 0;

if (this->internalTableNode)
{
q->mrmlScene()->RemoveNode(this->internalTableNode);
}
this->internalTableNode = 0;

if (this->astroTableNode)
Expand Down Expand Up @@ -1085,13 +1081,7 @@ void qSlicerAstroModelingModuleWidget::initializeTableNode(bool forceNew/* = fal

if (!d->internalTableNode)
{
vtkSmartPointer<vtkMRMLNode> tempInternalTableNode = NULL;
vtkMRMLNode *foo = this->mrmlScene()->CreateNodeByClass("vtkMRMLTableNode");
tempInternalTableNode.TakeReference(foo);
std::string internalTableNodeName = this->mrmlScene()->GenerateUniqueName("InternalTable");
tempInternalTableNode->SetName(internalTableNodeName.c_str());
this->mrmlScene()->AddNode(tempInternalTableNode);
d->internalTableNode = vtkMRMLTableNode::SafeDownCast(tempInternalTableNode);
d->internalTableNode = vtkSmartPointer<vtkMRMLTableNode>::New();
}

vtkSmartPointer<vtkMRMLNode> tableNode = NULL;
Expand Down

0 comments on commit 1aee1c3

Please sign in to comment.