Gui: [skip ci] fix issue found with -fsanitize-address-use-after-scope

This commit is contained in:
wmayer
2021-02-21 13:53:23 +01:00
parent 147542aef0
commit 786955e022

View File

@@ -976,7 +976,9 @@ void View3DInventorViewer::onSelectionChanged(const SelectionChanges &_Reason)
if(Reason.Type == SelectionChanges::RmvPreselect ||
Reason.Type == SelectionChanges::RmvPreselectSignal)
{
SoFCHighlightAction cAct(SelectionChanges::RmvPreselect);
//Hint: do not create a tmp. instance of SelectionChanges
SelectionChanges selChanges(SelectionChanges::RmvPreselect);
SoFCHighlightAction cAct(selChanges);
cAct.apply(pcViewProviderRoot);
} else {
SoFCSelectionAction cAct(Reason);