Fix some memory leaks

This commit is contained in:
wmayer
2012-11-14 17:12:42 +01:00
parent 367d7122db
commit 3b3aaa5bcd
2 changed files with 8 additions and 4 deletions

View File

@@ -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();
}
}