Fix some memory leaks
This commit is contained in:
parent
d2ac422f68
commit
07a17af70a
|
@ -835,10 +835,10 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action)
|
|||
SbVec3f z = vv.zVector();
|
||||
const SbViewportRegion & vpr = SoViewportRegionElement::get(state);
|
||||
|
||||
SoGetMatrixAction * getmatrixaction = new SoGetMatrixAction(vpr);
|
||||
getmatrixaction->apply(action);
|
||||
SoGetMatrixAction getmatrixaction(vpr);
|
||||
getmatrixaction.apply(action);
|
||||
|
||||
SbMatrix transform = getmatrixaction->getMatrix();
|
||||
SbMatrix transform = getmatrixaction.getMatrix();
|
||||
transform.multVecMatrix(surfNorm, surfNorm);
|
||||
|
||||
bool flip = surfNorm.dot(z) > FLT_EPSILON;
|
||||
|
|
|
@ -2631,6 +2631,9 @@ void ViewProviderSketch::rebuildConstraintsVisual(void)
|
|||
|
||||
// every constrained visual node gets its own material for preselection and selection
|
||||
SoMaterial *Material = new SoMaterial;
|
||||
// Not all kind of constraints need a material. So, increment its counter here and decrement
|
||||
// it later to avoid a memory leak.
|
||||
Material->ref();
|
||||
Material->diffuseColor = ConstrDimColor;
|
||||
|
||||
// distinguish different constraint types to build up
|
||||
|
@ -2718,9 +2721,10 @@ void ViewProviderSketch::rebuildConstraintsVisual(void)
|
|||
break;
|
||||
default:
|
||||
edit->vConstrType.push_back(None);
|
||||
}
|
||||
}
|
||||
|
||||
edit->constrGroup->addChild(sep);
|
||||
Material->unref();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user