From 9e32141a5fb726c19c550e49269e215c40cb643e Mon Sep 17 00:00:00 2001 From: vsonnier Date: Wed, 15 Feb 2017 20:45:46 +0100 Subject: [PATCH] MISC4: Fix ref count of VisualDataDistributor (harmless, currently unused) --- src/process/VisualProcessor.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/process/VisualProcessor.h b/src/process/VisualProcessor.h index 364dc57..7a9ee70 100644 --- a/src/process/VisualProcessor.h +++ b/src/process/VisualProcessor.h @@ -142,7 +142,12 @@ protected: } if (inp) { + int previousRefCount = inp->getRefCount(); VisualProcessor::distribute(inp); + //inp is now shared through the distribute(), which overwrite the previous ref count, + //so increment it properly. + int distributeRefCount = inp->getRefCount(); + inp->setRefCount(previousRefCount + distributeRefCount); } } }