fix several reference counting bugs

This commit is contained in:
wmayer
2018-08-18 16:01:55 +02:00
parent 74ac2e76f1
commit 721e37d888
2 changed files with 20 additions and 0 deletions

View File

@@ -1159,6 +1159,10 @@ SoBoxSelectionRenderAction::constructorCommon(void)
SoBoxSelectionRenderAction::~SoBoxSelectionRenderAction(void)
{
// clear highlighting node
if (PRIVATE(this)->highlightPath) {
PRIVATE(this)->highlightPath->unref();
}
PRIVATE(this)->postprocpath->unref();
PRIVATE(this)->localRoot->unref();
@@ -1218,6 +1222,10 @@ SoBoxSelectionRenderAction::apply(SoNode * node)
if (shapepath) {
SoPathList list;
list.append(shapepath);
// clear old highlighting node if still active
if (PRIVATE(this)->highlightPath) {
PRIVATE(this)->highlightPath->unref();
}
PRIVATE(this)->highlightPath = path;
PRIVATE(this)->highlightPath->ref();
this->drawBoxes(path, &list);
@@ -1262,6 +1270,10 @@ SoBoxSelectionRenderAction::apply(SoPath * path)
if (shapepath) {
SoPathList list;
list.append(shapepath);
// clear old highlighting node if still active
if (PRIVATE(this)->highlightPath) {
PRIVATE(this)->highlightPath->unref();
}
PRIVATE(this)->highlightPath = path;
PRIVATE(this)->highlightPath->ref();
this->drawBoxes(path, &list);