Gui: add coinRemoveAllChildren to work around Coin3D bug

See bug description:
https://bitbucket.org/Coin3D/coin/pull-requests/119/fix-sochildlist-auditing/diff

Because of path based rendering (SoFCPathAnnotation) in mouse over
highlight, this bug causes crash more frequently here comparing to
upstream.

All C++ calling of SoGroup::removeAllChildren() is replaced by
Gui::coinRemoveAllChildren(), and python code is fixed by monkey
patching SoGroup.removeAllChildren() in FreeCADGuiInit.py.
This commit is contained in:
Zheng, Lei
2019-05-31 06:28:00 +08:00
committed by wmayer
parent c744157e9a
commit c8891be856
36 changed files with 115 additions and 55 deletions

View File

@@ -243,6 +243,8 @@ public:
static PyObject* sInsert (PyObject *self,PyObject *args); // open Python scripts
static PyObject* sExport (PyObject *self,PyObject *args);
static PyObject* sCoinRemoveAllChildren (PyObject *self,PyObject *args);
static PyObject* sActiveDocument (PyObject *self,PyObject *args);
static PyObject* sSetActiveDocument (PyObject *self,PyObject *args);
static PyObject* sActiveView (PyObject *self,PyObject *args);

View File

@@ -197,6 +197,9 @@ PyMethodDef Application::Methods[] = {
"removeDocumentObserver() -> None\n\n"
"Remove an added document observer."},
{"coinRemoveAllChildren", (PyCFunction) Application::sCoinRemoveAllChildren, METH_VARARGS,
"Remove all children from a group node"},
{NULL, NULL, 0, NULL} /* Sentinel */
};
@@ -1327,3 +1330,18 @@ PyObject* Application::sRemoveDocObserver(PyObject * /*self*/, PyObject *args)
Py_Return;
} PY_CATCH;
}
PyObject* Application::sCoinRemoveAllChildren(PyObject * /*self*/, PyObject *args)
{
PyObject *pynode;
if (!PyArg_ParseTuple(args, "O", &pynode))
return NULL;
PY_TRY {
void* ptr = 0;
Base::Interpreter().convertSWIGPointerObj("pivy.coin","_p_SoGroup", pynode, &ptr, 0);
coinRemoveAllChildren(reinterpret_cast<SoGroup*>(ptr));
Py_Return;
}PY_CATCH;
}

View File

@@ -1559,7 +1559,7 @@ void Document::handleChildren3D(ViewProvider* viewProvider)
if (childGroup->getNumChildren() != static_cast<int>(children.size())) {
rebuild = true;
childGroup->removeAllChildren();
Gui::coinRemoveAllChildren(childGroup);
for (std::vector<App::DocumentObject*>::iterator it=children.begin();it!=children.end();++it) {
ViewProvider* ChildViewProvider = getViewProvider(*it);

View File

@@ -171,6 +171,21 @@ FreeCADGui.Workbench = Workbench
Gui.addWorkbench(NoneWorkbench())
# Monkey patching pivy.coin.SoGroup.removeAllChildren to work around a bug
# https://bitbucket.org/Coin3D/coin/pull-requests/119/fix-sochildlist-auditing/diff
def _SoGroup_init(self,*args):
import types
_SoGroup_init_orig(self,*args)
self.removeAllChildren = \
types.MethodType(FreeCADGui.coinRemoveAllChildren,self)
try:
from pivy import coin
_SoGroup_init_orig = coin.SoGroup.__init__
coin.SoGroup.__init__ = _SoGroup_init
except Exception:
pass
# init modules
InitApplications()

View File

@@ -848,8 +848,8 @@ void ManualAlignment::startAlignment(Base::Type mousemodel)
void ManualAlignment::continueAlignment()
{
myFixedGroup.clearPoints();
d->picksepLeft->removeAllChildren();
d->picksepRight->removeAllChildren();
coinRemoveAllChildren(d->picksepLeft);
coinRemoveAllChildren(d->picksepRight);
if (!myAlignModel.isEmpty()) {
AlignmentGroup& grp = myAlignModel.activeGroup();
@@ -891,8 +891,8 @@ void ManualAlignment::reset()
myFixedGroup.setAlignable(false);
myFixedGroup.clear();
d->picksepLeft->removeAllChildren();
d->picksepRight->removeAllChildren();
coinRemoveAllChildren(d->picksepLeft);
coinRemoveAllChildren(d->picksepRight);
if (myDocument) {
this->connectDocumentDeletedObject.disconnect();
@@ -1186,8 +1186,8 @@ void ManualAlignment::onClear()
myAlignModel.activeGroup().clear();
myFixedGroup.clear();
d->picksepLeft->removeAllChildren();
d->picksepRight->removeAllChildren();
coinRemoveAllChildren(d->picksepLeft);
coinRemoveAllChildren(d->picksepRight);
}
void ManualAlignment::onCancel()

View File

@@ -39,6 +39,7 @@
#include "DlgSettingsColorGradientImp.h"
#include "MainWindow.h"
#include "MDIView.h"
#include "ViewProvider.h"
using namespace Gui;
@@ -83,7 +84,7 @@ void SoFCColorGradient::finish()
void SoFCColorGradient::setMarkerLabel( const SoMFString& label )
{
labels->removeAllChildren();
coinRemoveAllChildren(labels);
float fH=8.0f;
int num = label.getNum();
@@ -294,7 +295,7 @@ void SoFCColorGradient::rebuildGradient()
// first clear the children
if ( getNumChildren() > 0 )
removeAllChildren();
coinRemoveAllChildren(this);
addChild(ttype);
addChild(labels);
addChild(coords);

View File

@@ -34,6 +34,7 @@
# include <Inventor/nodes/SoTransform.h>
#endif
#include "ViewProvider.h"
#include "SoFCColorLegend.h"
@@ -81,7 +82,7 @@ void SoFCColorLegend::finish()
void SoFCColorLegend::setMarkerLabel( const SoMFString& label )
{
labels->removeAllChildren();
coinRemoveAllChildren(labels);
int num = label.getNum();
if ( num > 1 )
@@ -234,7 +235,7 @@ void SoFCColorLegend::setColorModel( App::ColorGradient::TColorModel tModel )
// first clear the children
if ( getNumChildren() > 0 )
removeAllChildren();
coinRemoveAllChildren(this);
addChild(labels);
addChild(coords);
addChild(mat);

View File

@@ -611,7 +611,7 @@ View3DInventorViewer::~View3DInventorViewer()
// the root node but isn't destroyed when closing this viewer so
// that it prevents all children from being deleted. To reduce this
// likelihood we explicitly remove all child nodes now.
this->pcViewProviderRoot->removeAllChildren();
coinRemoveAllChildren(this->pcViewProviderRoot);
this->pcViewProviderRoot->unref();
this->pcViewProviderRoot = 0;
this->backlight->unref();
@@ -3307,8 +3307,8 @@ void View3DInventorViewer::turnAllDimensionsOff()
void View3DInventorViewer::eraseAllDimensions()
{
static_cast<SoSwitch*>(dimensionRoot->getChild(0))->removeAllChildren();
static_cast<SoSwitch*>(dimensionRoot->getChild(1))->removeAllChildren();
coinRemoveAllChildren(static_cast<SoSwitch*>(dimensionRoot->getChild(0)));
coinRemoveAllChildren(static_cast<SoSwitch*>(dimensionRoot->getChild(1)));
}
void View3DInventorViewer::turn3dDimensionsOn()

View File

@@ -68,6 +68,24 @@ using namespace std;
using namespace Gui;
namespace Gui {
void coinRemoveAllChildren(SoGroup *group) {
if(!group)
return;
int count = group->getNumChildren();
if(!count)
return;
FC_TRACE("coin remove all children " << count);
SbBool autonotify = group->enableNotify(FALSE);
for(;count>0;--count)
group->removeChild(count-1);
group->enableNotify(autonotify);
group->touch();
}
} // namespace Gui
//**************************************************************************
//**************************************************************************
// ViewProvider

View File

@@ -102,6 +102,11 @@ public:
}
};
/** Helper function to deal with bug in SoNode::removeAllChildren()
*
* @sa https://bitbucket.org/Coin3D/coin/pull-requests/119/fix-sochildlist-auditing/diff
*/
void GuiExport coinRemoveAllChildren(SoGroup *node);
/** General interface for all visual stuff in FreeCAD
* This class is used to generate and handle all around

View File

@@ -95,7 +95,7 @@ void ViewProviderInventorObject::updateData(const App::Property* prop)
// read from buffer
SoInput in;
std::string buffer = ivObj->Buffer.getValue();
pcBuffer->removeAllChildren();
coinRemoveAllChildren(pcBuffer);
if (buffer.empty()) return;
in.setBuffer((void *)buffer.c_str(), buffer.size());
SoSeparator * node = SoDB::readAll(&in);
@@ -112,7 +112,7 @@ void ViewProviderInventorObject::updateData(const App::Property* prop)
QString fn = QString::fromUtf8(filename);
QFile file(fn);
SoInput in;
pcFile->removeAllChildren();
coinRemoveAllChildren(pcFile);
if (!fn.isEmpty() && file.open(QFile::ReadOnly)) {
QByteArray buffer = file.readAll();
in.setBuffer((void *)buffer.constData(), buffer.length());

View File

@@ -216,7 +216,7 @@ void ViewProviderVRMLObject::updateData(const App::Property* prop)
QString fn = QString::fromUtf8(filename);
QFile file(fn);
SoInput in;
pcVRML->removeAllChildren();
coinRemoveAllChildren(pcVRML);
if (!fn.isEmpty() && file.open(QFile::ReadOnly)) {
QFileInfo fi(fn);
QByteArray filepath = fi.absolutePath().toUtf8();

View File

@@ -118,7 +118,7 @@ void ViewProviderFemConstraintBearing::updateData(const App::Property* prop)
if (strcmp(prop->getName(),"BasePoint") == 0) {
// Remove and recreate the symbol
pShapeSep->removeAllChildren();
Gui::coinRemoveAllChildren(pShapeSep);
// This should always point outside of the cylinder
Base::Vector3d normal = pcConstraint->NormalDirection.getValue();

View File

@@ -121,7 +121,7 @@ void ViewProviderFemConstraintContact::updateData(const App::Property* prop)
std::vector<Base::Vector3d>::const_iterator n = normals.begin();
// Points and Normals are always updated together
pShapeSep->removeAllChildren();
Gui::coinRemoveAllChildren(pShapeSep);
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {
//Define base and normal directions

View File

@@ -186,7 +186,7 @@ void ViewProviderFemConstraintDisplacement::updateData(const App::Property* prop
int idrotz = 0;
#else
// Note: Points and Normals are always updated together
pShapeSep->removeAllChildren();
Gui::coinRemoveAllChildren(pShapeSep);
#endif
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {

View File

@@ -143,7 +143,7 @@ void ViewProviderFemConstraintFixed::updateData(const App::Property* prop)
int idx = 0;
#else
// Note: Points and Normals are always updated together
pShapeSep->removeAllChildren();
Gui::coinRemoveAllChildren(pShapeSep);
#endif
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {

View File

@@ -170,7 +170,7 @@ void ViewProviderFemConstraintFluidBoundary::updateData(const App::Property* pro
int idx = 0;
#else
// Redraw all arrows
pShapeSep->removeAllChildren();
Gui::coinRemoveAllChildren(pShapeSep);
#endif
// This should always point outside of the solid
Base::Vector3d normal = pcConstraint->NormalDirection.getValue();
@@ -272,7 +272,7 @@ void ViewProviderFemConstraintFluidBoundary::updateData(const App::Property* pro
int idx = 0;
#else
// Note: Points and Normals are always updated together
pShapeSep->removeAllChildren();
Gui::coinRemoveAllChildren(pShapeSep);
#endif
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {

View File

@@ -139,7 +139,7 @@ void ViewProviderFemConstraintForce::updateData(const App::Property* prop)
int idx = 0;
#else
// Redraw all arrows
pShapeSep->removeAllChildren();
Gui::coinRemoveAllChildren(pShapeSep);
#endif
// This should always point outside of the solid
Base::Vector3d normal = pcConstraint->NormalDirection.getValue();

View File

@@ -115,7 +115,7 @@ void ViewProviderFemConstraintGear::updateData(const App::Property* prop)
if (strcmp(prop->getName(),"BasePoint") == 0) {
if (pcConstraint->Height.getValue() > Precision::Confusion()) {
// Remove and recreate the symbol
pShapeSep->removeAllChildren();
Gui::coinRemoveAllChildren(pShapeSep);
Base::Vector3d base = pcConstraint->BasePoint.getValue();
Base::Vector3d axis = pcConstraint->Axis.getValue();

View File

@@ -120,7 +120,7 @@ void ViewProviderFemConstraintHeatflux::updateData(const App::Property* prop)
std::vector<Base::Vector3d>::const_iterator n = normals.begin();
// Note: Points and Normals are always updated together
pShapeSep->removeAllChildren();
Gui::coinRemoveAllChildren(pShapeSep);
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {
//Define base and normal directions

View File

@@ -119,7 +119,7 @@ void ViewProviderFemConstraintPlaneRotation::updateData(const App::Property* pro
std::vector<Base::Vector3d>::const_iterator n = normals.begin();
// Points and Normals are always updated together
pShapeSep->removeAllChildren();
Gui::coinRemoveAllChildren(pShapeSep);
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {
//Define base and normal directions

View File

@@ -127,7 +127,7 @@ void ViewProviderFemConstraintPressure::updateData(const App::Property* prop)
int idx = 0;
#else
// Redraw all arrows
pShapeSep->removeAllChildren();
Gui::coinRemoveAllChildren(pShapeSep);
#endif
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {

View File

@@ -114,7 +114,7 @@ void ViewProviderFemConstraintPulley::updateData(const App::Property* prop)
if (strcmp(prop->getName(),"BasePoint") == 0) {
if (pcConstraint->Height.getValue() > Precision::Confusion()) {
// Remove and recreate the symbol
pShapeSep->removeAllChildren();
Gui::coinRemoveAllChildren(pShapeSep);
// This should always point outside of the cylinder
Base::Vector3d base = pcConstraint->BasePoint.getValue();

View File

@@ -119,7 +119,7 @@ void ViewProviderFemConstraintTemperature::updateData(const App::Property* prop)
std::vector<Base::Vector3d>::const_iterator n = normals.begin();
// Note: Points and Normals are always updated together
pShapeSep->removeAllChildren();
Gui::coinRemoveAllChildren(pShapeSep);
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {
//Define base and normal directions

View File

@@ -135,7 +135,7 @@ void ViewProviderFemConstraintTransform::updateData(const App::Property* prop)
std::vector<Base::Vector3d>::const_iterator n = normals.begin();
// Points and Normals are always updated together
pShapeSep->removeAllChildren();
Gui::coinRemoveAllChildren(pShapeSep);
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {
SbVec3f base(p->x, p->y, p->z);
@@ -269,7 +269,7 @@ void ViewProviderFemConstraintTransform::updateData(const App::Property* prop)
} else if (transform_type == "Cylindrical") {
// Points and Normals are always updated together
pShapeSep->removeAllChildren();
Gui::coinRemoveAllChildren(pShapeSep);
const std::vector<Base::Vector3d>& points = pcConstraint->Points.getValues();
const std::vector<Base::Vector3d>& normals = pcConstraint->Normals.getValues();

View File

@@ -232,7 +232,7 @@ void ViewProviderInspection::updateData(const App::Property* prop)
}
}
this->pcLinkRoot->removeAllChildren();
Gui::coinRemoveAllChildren(this->pcLinkRoot);
this->pcLinkRoot->addChild(this->pcCoords);
this->pcCoords->point.setNum(points.size());
SbVec3f* pts = this->pcCoords->point.startEditing();

View File

@@ -478,11 +478,11 @@ void MeshFillHole::startEditing(MeshGui::ViewProviderMesh* vp)
myConnection = App::GetApplication().signalChangedObject.connect(
boost::bind(&MeshFillHole::slotChangedObject, this, _1, _2));
myBoundariesRoot->removeAllChildren();
Gui::coinRemoveAllChildren(myBoundariesRoot);
myBoundariesRoot->addChild(viewer->getHeadlight());
myBoundariesRoot->addChild(viewer->getSoRenderManager()->getCamera());
myBoundariesRoot->addChild(myBoundariesGroup);
myBoundaryRoot->removeAllChildren();
Gui::coinRemoveAllChildren(myBoundaryRoot);
myBoundaryRoot->addChild(viewer->getHeadlight());
myBoundaryRoot->addChild(viewer->getSoRenderManager()->getCamera());
createPolygons();
@@ -541,7 +541,7 @@ void MeshFillHole::closeBridge()
void MeshFillHole::slotChangedObject(const App::DocumentObject& Obj, const App::Property& Prop)
{
if (&Obj == myMesh && strcmp(Prop.getName(),"Mesh") == 0) {
myBoundariesGroup->removeAllChildren();
Gui::coinRemoveAllChildren(myBoundariesGroup);
myVertex->point.setNum(0);
myNumPoints = 0;
myPolygon.clear();

View File

@@ -290,7 +290,7 @@ void ViewProviderMeshCurvature::updateData(const App::Property* prop)
// set to the expected size
if (prop->getTypeId().isDerivedFrom(App::PropertyLink::getClassTypeId())) {
Mesh::Feature* object = static_cast<const App::PropertyLink*>(prop)->getValue<Mesh::Feature*>();
this->pcLinkRoot->removeAllChildren();
Gui::coinRemoveAllChildren(this->pcLinkRoot);
if (object) {
const Mesh::MeshObject& kernel = object->Mesh.getValue();
pcColorMat->diffuseColor.setNum((int)kernel.countPoints());

View File

@@ -154,7 +154,7 @@ void ViewProviderMeshFaceSet::updateData(const App::Property* prop)
if (direct != directRendering) {
directRendering = direct;
pcShapeGroup->removeAllChildren();
Gui::coinRemoveAllChildren(pcShapeGroup);
if (directRendering) {
pcShapeGroup->addChild(pcMeshNode);

View File

@@ -128,7 +128,7 @@ SoSeparator* ViewProvider2DObject::createGrid(void)
double zGrid = 0.0; // carpet-grid separation
SoGroup *parent = new Gui::SoSkipBoundingGroup();
GridRoot->removeAllChildren();
Gui::coinRemoveAllChildren(GridRoot);
GridRoot->addChild(parent);
SoBaseColor *mycolor;
SoVertexProperty *vts;
@@ -228,7 +228,7 @@ void ViewProvider2DObject::updateData(const App::Property* prop)
if (prop->getTypeId() == Part::PropertyPartShape::getClassTypeId()) {
Base::BoundBox3d bbox = static_cast<const Part::PropertyPartShape*>(prop)->getBoundingBox();
if (!bbox.IsValid()) return;
GridRoot->removeAllChildren();
Gui::coinRemoveAllChildren(GridRoot);
Base::Placement place = static_cast<const Part::PropertyPartShape*>(prop)->getComplexData()->getPlacement();
place.invert();
Base::ViewProjMatrix proj(place.toMatrix());
@@ -252,11 +252,11 @@ void ViewProvider2DObject::onChanged(const App::Property* prop)
if (ShowGrid.getValue())
createGrid();
else
GridRoot->removeAllChildren();
Gui::coinRemoveAllChildren(GridRoot);
}
if ((prop == &GridSize) || (prop == &GridStyle) || (prop == &TightGrid)) {
if (ShowGrid.getValue()) {
GridRoot->removeAllChildren();
Gui::coinRemoveAllChildren(GridRoot);
createGrid();
}
}

View File

@@ -118,8 +118,8 @@ void ViewProviderCurveNet::updateData(const App::Property* prop)
if (cShape.IsNull())
return;
EdgeRoot->removeAllChildren();
VertexRoot->removeAllChildren();
Gui::coinRemoveAllChildren(EdgeRoot);
Gui::coinRemoveAllChildren(VertexRoot);
try{
computeEdges (EdgeRoot,cShape);

View File

@@ -167,7 +167,7 @@ void ViewProviderMirror::unsetEdit(int ModNum)
mf->Normal.setValue(norm[0],norm[1],norm[2]);
pcRoot->removeChild(pcEditNode);
pcEditNode->removeAllChildren();
Gui::coinRemoveAllChildren(pcEditNode);
}
else {
ViewProviderPart::unsetEdit(ModNum);

View File

@@ -93,7 +93,7 @@ void ViewProviderSpline::updateData(const App::Property* prop)
if (prop->getTypeId() == Part::PropertyPartShape::getClassTypeId() && strcmp(prop->getName(), "Shape") == 0) {
// update control points if there
if (pcControlPoints) {
pcControlPoints->removeAllChildren();
Gui::coinRemoveAllChildren(pcControlPoints);
showControlPoints(this->ControlPoints.getValue(), prop);
}
}

View File

@@ -119,12 +119,12 @@ void ViewProviderTransformed::unsetEdit(int ModNum)
while (pcRejectedRoot->getNumChildren() > 7) {
SoSeparator* sep = static_cast<SoSeparator*>(pcRejectedRoot->getChild(7));
SoMultipleCopy* rejectedTrfms = static_cast<SoMultipleCopy*>(sep->getChild(2));
rejectedTrfms ->removeAllChildren();
Gui::coinRemoveAllChildren(rejectedTrfms);
sep->removeChild(1);
sep->removeChild(0);
pcRejectedRoot ->removeChild(7);
}
pcRejectedRoot->removeAllChildren();
Gui::coinRemoveAllChildren(pcRejectedRoot);
pcRoot->removeChild(pcRejectedRoot);
@@ -168,7 +168,7 @@ void ViewProviderTransformed::recomputeFeature(void)
while (pcRejectedRoot->getNumChildren() > 7) {
SoSeparator* sep = static_cast<SoSeparator*>(pcRejectedRoot->getChild(7));
SoMultipleCopy* rejectedTrfms = static_cast<SoMultipleCopy*>(sep->getChild(2));
rejectedTrfms ->removeAllChildren();
Gui::coinRemoveAllChildren(rejectedTrfms);
sep->removeChild(1);
sep->removeChild(0);
pcRejectedRoot ->removeChild(7);

View File

@@ -111,7 +111,7 @@ void ViewProviderRobotObject::setDragger()
void ViewProviderRobotObject::resetDragger()
{
assert(pcDragger);
pcTcpRoot->removeAllChildren();
Gui::coinRemoveAllChildren(pcTcpRoot);
pcDragger = 0;
}
@@ -181,7 +181,7 @@ void ViewProviderRobotObject::updateData(const App::Property* prop)
QString fn = QString::fromUtf8(filename);
QFile file(fn);
SoInput in;
pcRobotRoot->removeAllChildren();
Gui::coinRemoveAllChildren(pcRobotRoot);
if (!fn.isEmpty() && file.open(QFile::ReadOnly)) {
QByteArray buffer = file.readAll();
in.setBuffer((void *)buffer.constData(), buffer.length());

View File

@@ -3528,7 +3528,7 @@ void ViewProviderSketch::draw(bool temp /*=false*/, bool rebuildinformationlayer
// information layer
if(rebuildinformationlayer) {
// every time we start with empty information layer
edit->infoGroup->removeAllChildren();
Gui::coinRemoveAllChildren(edit->infoGroup);
}
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
@@ -4282,7 +4282,7 @@ void ViewProviderSketch::draw(bool temp /*=false*/, bool rebuildinformationlayer
if (ShowGrid.getValue())
createGrid();
else
GridRoot->removeAllChildren();
Gui::coinRemoveAllChildren(GridRoot);
edit->RootCrossCoordinate->point.set1Value(0,SbVec3f(-dMagF, 0.0f, zCross));
edit->RootCrossCoordinate->point.set1Value(1,SbVec3f(dMagF, 0.0f, zCross));
@@ -5297,7 +5297,7 @@ void ViewProviderSketch::rebuildConstraintsVisual(void)
{
const std::vector<Sketcher::Constraint *> &constrlist = getSketchObject()->Constraints.getValues();
// clean up
edit->constrGroup->removeAllChildren();
Gui::coinRemoveAllChildren(edit->constrGroup);
edit->vConstrType.clear();
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
@@ -6056,7 +6056,7 @@ void ViewProviderSketch::unsetEdit(int ModNum)
if (edit->sketchHandler)
deactivateHandler();
edit->EditRoot->removeAllChildren();
Gui::coinRemoveAllChildren(edit->EditRoot);
pcRoot->removeChild(edit->EditRoot);
//visibility autoation