From: Alexey K. <akh...@us...> - 2008-05-30 16:53:17
|
Update of /cvsroot/aaf/AAF/ref-impl/src/impl In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv6655/ref-impl/src/impl Modified Files: ImplAAFTypeDefFixedArray.cpp Log Message: Fix memory leaks - In GetElements() an object returned by CreateImpl() is already reference counted, no need for extra AcquireReference(). Index: ImplAAFTypeDefFixedArray.cpp =================================================================== RCS file: /cvsroot/aaf/AAF/ref-impl/src/impl/ImplAAFTypeDefFixedArray.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** ImplAAFTypeDefFixedArray.cpp 6 Feb 2007 15:46:17 -0000 1.52 --- ImplAAFTypeDefFixedArray.cpp 30 May 2008 16:53:24 -0000 1.53 *************** *** 14,18 **** // under the License. // ! // The Original Code of this file is Copyright 1998-2006, Licensor of the // AAF Association. // --- 14,18 ---- // under the License. // ! // The Original Code of this file is Copyright 1998-2008, Licensor of the // AAF Association. // *************** *** 179,187 **** return hr; } ! pEnum->AcquireReference(); ! *ppEnum = pEnum; ! ! return AAFRESULT_SUCCESS; } --- 179,191 ---- return hr; } + if ( AAFRESULT_SUCCEEDED( hr ) ) { + pEnum->AcquireReference(); + *ppEnum = pEnum; + } + + pEnum->ReleaseReference(); + pEnum = NULL; ! return hr; } |