From fbebce0a49a846bfcfa18fd80992260a922c9263 Mon Sep 17 00:00:00 2001 From: dhickin Date: Wed, 11 Feb 2015 22:17:45 +0000 Subject: [PATCH] Make sure postPut is called precisely once and after put in Convert::copyUnion. --- src/factory/Convert.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/factory/Convert.cpp b/src/factory/Convert.cpp index 359ea75..fd67c2a 100644 --- a/src/factory/Convert.cpp +++ b/src/factory/Convert.cpp @@ -472,10 +472,14 @@ void Convert::copyUnion(PVUnionPtr const & from, PVUnionPtr const & to) if (toValue.get() == 0 || *toValue->getField() != *fromValue->getField()) { toValue = pvDataCreate->createPVField(fromValue->getField()); + copy(fromValue, toValue); to->set(toValue); } - copy(fromValue, toValue); - to->postPut(); + else + { + copy(fromValue, toValue); + to->postPut(); + } } } else