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