From 6630bcf9fa8e849fe846d1c2b780148a7a2c1e4b Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 20 Feb 2017 10:08:18 +0100 Subject: [PATCH] issue #0001999: [STEP] Tessellation data or OpenInventor data memory leak --- src/Gui/SoFCUnifiedSelection.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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();