diff --git a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.C b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.C index ab0d8f726..d4ee78d09 100644 --- a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.C +++ b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.C @@ -51,7 +51,8 @@ HashPtrTable::HashPtrTable(const HashPtrTable& ht) { for (const_iterator iter = ht.begin(); iter != ht.end(); ++iter) { - insert(iter.key(), new T(**iter)); + // Bug fix, Microsoft port. HJ, 21/Mar/2011 + insert(iter.key(), iter()->clone().ptr()); } } @@ -117,7 +118,10 @@ void HashPtrTable::clear() // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template -void HashPtrTable::operator=(const HashPtrTable& ht) +void HashPtrTable::operator= +( + const HashPtrTable& ht +) { // Check for assignment to self if (this == &ht) @@ -134,7 +138,8 @@ void HashPtrTable::operator=(const HashPtrTable& ht) for(const_iterator iter = ht.begin(); iter != ht.end(); ++iter) { - insert(iter.key(), new T(**iter)); + // Bug fix, Microsoft port. HJ, 21/Mar/2011 + insert(iter.key(), iter()->clone().ptr()); } }