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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user