Description
ValueVectorOf has been changed to call the object destructors for example in ~ValueOfVector:
template <class TElem> ValueVectorOf<TElem>::~ValueVectorOf()
{
if (fCallDestructor) {
for (XMLSize_t index=fMaxCount; index > 0; index--)
fElemList[index-1].~TElem();
}
fMemoryManager->deallolink titlecate(fElemList); //delete [] fElemList;
{color:#205081}}
But the code is missing in ValueVectorOf<TElem>::operator=.
A sample code is attached with the corresponding valgrind reports. The sample covers the case where the buffer shrinks (no realloc) or grows (pass realloc as argument to the command).
The attached patch fixes the leak.