MISC4: Fix ref count of VisualDataDistributor (harmless, currently unused)

This commit is contained in:
vsonnier 2017-02-15 20:45:46 +01:00
parent 3ed65eff8e
commit 9e32141a5f

View File

@ -142,7 +142,12 @@ protected:
}
if (inp) {
int previousRefCount = inp->getRefCount();
VisualProcessor<OutputDataType, OutputDataType>::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);
}
}
}