+ fix memory leak
This commit is contained in:
parent
578fbbefa4
commit
ced08b0416
|
@ -146,19 +146,19 @@ SoSeparator* ViewProvider2DObject::createGrid(void)
|
||||||
mycolor->rgb.setValue(0.7f, 0.7f ,0.7f);
|
mycolor->rgb.setValue(0.7f, 0.7f ,0.7f);
|
||||||
parent->addChild(mycolor);
|
parent->addChild(mycolor);
|
||||||
|
|
||||||
|
if (GridStyle.getValue() == 0) {
|
||||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Part");
|
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Part");
|
||||||
int pattern = hGrp->GetInt("GridLinePattern", 0x0f0f);
|
int pattern = hGrp->GetInt("GridLinePattern", 0x0f0f);
|
||||||
SoDrawStyle* DefaultStyle = new SoDrawStyle;
|
SoDrawStyle* DefaultStyle = new SoDrawStyle;
|
||||||
DefaultStyle->lineWidth = 1;
|
DefaultStyle->lineWidth = 1;
|
||||||
DefaultStyle->linePattern = pattern;
|
DefaultStyle->linePattern = pattern;
|
||||||
|
parent->addChild(DefaultStyle);
|
||||||
|
}
|
||||||
|
else {
|
||||||
SoMaterial* LightStyle = new SoMaterial;
|
SoMaterial* LightStyle = new SoMaterial;
|
||||||
LightStyle->transparency = 0.7f;
|
LightStyle->transparency = 0.7f;
|
||||||
|
|
||||||
if (GridStyle.getValue() == 0)
|
|
||||||
parent->addChild(DefaultStyle);
|
|
||||||
else
|
|
||||||
parent->addChild(LightStyle);
|
parent->addChild(LightStyle);
|
||||||
|
}
|
||||||
|
|
||||||
SoPickStyle* PickStyle = new SoPickStyle;
|
SoPickStyle* PickStyle = new SoPickStyle;
|
||||||
PickStyle->style = SoPickStyle::UNPICKABLE;
|
PickStyle->style = SoPickStyle::UNPICKABLE;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user