Skip to content

Commit

Permalink
+ Fix reference leak in _getSupportIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Mar 25, 2014
1 parent dc6eeb1 commit 12277cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Mod/Part/App/TopoShapePyImp.cpp
Expand Up @@ -1491,17 +1491,17 @@ PyObject* _getSupportIndex(char* suppStr, TopoShape* ts, TopoDS_Shape suppShape)
TopoDS_Shape subShape;

unsigned long nSubShapes = ts->countSubShapes(suppStr);
PyObject* pSupportIndex = PyInt_FromLong(-1);
long supportIndex = -1;
for (unsigned long j=1; j<=nSubShapes; j++){
ss.str("");
ss << suppStr << j;
subShape = ts->getSubShape(ss.str().c_str());
if (subShape.IsEqual(suppShape)) {
pSupportIndex = PyInt_FromLong(j-1);
supportIndex = j-1;
break;
}
}
return pSupportIndex;
return PyInt_FromLong(supportIndex);
}

PyObject* TopoShapePy::distToShape(PyObject *args)
Expand Down

0 comments on commit 12277cc

Please sign in to comment.