From: Vladimir <vla...@us...> - 2008-04-28 16:02:23
|
Update of /cvsroot/aaf/AAF/ref-impl/src/impl In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv15467 Modified Files: ImplAAFComponent.cpp Log Message: Fix memory leaks - Destroy _attributes and _userComments in the destructor. Index: ImplAAFComponent.cpp =================================================================== RCS file: /cvsroot/aaf/AAF/ref-impl/src/impl/ImplAAFComponent.cpp,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** ImplAAFComponent.cpp 15 Jun 2006 19:52:49 -0000 1.57 --- ImplAAFComponent.cpp 28 Apr 2008 16:01:44 -0000 1.58 *************** *** 84,87 **** --- 84,111 ---- } } + + if(_userComments.isPresent()) + { + aafUInt32 count = _userComments.count(); + for (aafUInt32 j = 0; j < count; j++) + { + ImplAAFTaggedValue* pTaggedValue = _userComments.clearValueAt(j); + if (pTaggedValue) + pTaggedValue->ReleaseReference(); + pTaggedValue = 0; + } + } + + if(_attributes.isPresent()) + { + aafUInt32 count = _attributes.count(); + for (aafUInt32 j = 0; j < count; j++) + { + ImplAAFTaggedValue* pTaggedValue = _attributes.clearValueAt(j); + if (pTaggedValue) + pTaggedValue->ReleaseReference(); + pTaggedValue = 0; + } + } } |