diff --git a/src/Gui/SoFCUnifiedSelection.cpp b/src/Gui/SoFCUnifiedSelection.cpp index e0cbaf5260..ac4d1e3e45 100644 --- a/src/Gui/SoFCUnifiedSelection.cpp +++ b/src/Gui/SoFCUnifiedSelection.cpp @@ -375,6 +375,12 @@ void SoFCUnifiedSelection::doAction(SoAction *action) currenthighlight = 0; } } else if (hilaction->SelChange.Type == SelectionChanges::SetPreselect) { + if (currenthighlight) { + SoHighlightElementAction action; + action.apply(currenthighlight); + currenthighlight->unref(); + currenthighlight = 0; + } App::Document* doc = App::GetApplication().getDocument(hilaction->SelChange.pDocName); App::DocumentObject* obj = doc->getObject(hilaction->SelChange.pObjectName); ViewProvider*vp = Application::Instance->getViewProvider(obj);