fix bug related to PVStructurePtr createPVStructure(

StringArray const & fieldNames,PVFieldPtrArray const & pvFields);
The old implementation created a new version of each element of pvField.
The new version uses the version from pvFields.
There is a new shared pointer but the new shared pointer referenced the
same PVField as the original.
This commit is contained in:
Marty Kraimer
2012-09-28 06:33:39 -04:00
parent 6a378dae0d
commit a23631a8ca
4 changed files with 3692 additions and 70 deletions

View File

@@ -652,10 +652,6 @@ PVStructurePtr PVDataCreate::createPVStructure(
for (size_t i=0;i<num;i++) fields[i] = pvFields[i]->getField();
StructureConstPtr structure = fieldCreate->createStructure(fieldNames,fields);
PVStructurePtr pvStructure(new PVStructure(structure,pvFields));
const PVFieldPtrArray & xxx = pvStructure->getPVFields();
for(size_t i=0; i<pvFields.size();i++) {
convert->copy(pvFields[i],xxx[i]);
}
return pvStructure;
}