diff --git a/src/Gui/SoFCUnifiedSelection.cpp b/src/Gui/SoFCUnifiedSelection.cpp index bfb438aa5e67..6297e7621754 100644 --- a/src/Gui/SoFCUnifiedSelection.cpp +++ b/src/Gui/SoFCUnifiedSelection.cpp @@ -395,6 +395,11 @@ SoFCUnifiedSelection::handleEvent(SoHandleEventAction * action) currenthighlight = 0; //old_state = !highlighted; } + else if (currenthighlight) { + // clean-up the highlight path before assigning a new path + currenthighlight->unref(); + currenthighlight = 0; + } currenthighlight = static_cast(sa.getPath()->copy()); currenthighlight->ref();