[GUI] Fix memory leak in ViewProviderPlane.cpp

This commit is contained in:
xtemp09
2023-10-07 02:15:51 +07:00
committed by wwmayer
parent 13dce7864d
commit a710eb23c2

View File

@@ -82,11 +82,11 @@ void ViewProviderPlane::attach ( App::DocumentObject *obj ) {
auto material = new SoMaterial();
material->transparency.setValue(0.95f);
auto color = new SbColor();
SbColor color;
float alpha = 0.0f;
color->setPackedValue(ViewProviderOrigin::defaultColor, alpha);
material->ambientColor.setValue(*color);
material->diffuseColor.setValue(*color);
color.setPackedValue(ViewProviderOrigin::defaultColor, alpha);
material->ambientColor.setValue(color);
material->diffuseColor.setValue(color);
faceSeparator->addChild(material);
// disable backface culling and render with two-sided lighting