From: Alexey K. <akh...@us...> - 2008-05-30 16:53:42
|
Update of /cvsroot/aaf/AAF/test/com/ComModTestAAF/ModuleTests In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv6834/test/com/ComModTestAAF/ModuleTests Modified Files: CAAFDescriptiveMarkerTest.cpp Log Message: Move the declaration of an instance of mtc::SimpleFilePointers outside the try-catch block to avoid releasing IAAFFile pointer before the file is closed. Index: CAAFDescriptiveMarkerTest.cpp =================================================================== RCS file: /cvsroot/aaf/AAF/test/com/ComModTestAAF/ModuleTests/CAAFDescriptiveMarkerTest.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CAAFDescriptiveMarkerTest.cpp 7 Sep 2005 19:52:58 -0000 1.5 --- CAAFDescriptiveMarkerTest.cpp 30 May 2008 16:53:44 -0000 1.6 *************** *** 137,140 **** --- 137,142 ---- aafProductIdentification_constref productID) { + mtc::SimpleFilePointers filePointers; + try { using namespace mtc; *************** *** 142,146 **** IAAFSmartPointer<IAAFHeader> pHeader; IAAFSmartPointer<IAAFDictionary> pDict; - SimpleFilePointers filePointers; CreateSimpleAAFFile( pFileName, fileKind, --- 144,147 ---- *************** *** 202,205 **** --- 203,209 ---- } catch( const AAFRESULT& hr ) { + if(filePointers.pFile) { + filePointers.pFile->Close(); + } return hr; } *************** *** 210,217 **** static HRESULT ReadAAFFile(aafWChar * pFileName) { try { using namespace mtc; - SimpleFilePointers filePointers; ReadSimpleAAFFile( pFileName, &filePointers ); --- 214,222 ---- static HRESULT ReadAAFFile(aafWChar * pFileName) { + mtc::SimpleFilePointers filePointers; + try { using namespace mtc; ReadSimpleAAFFile( pFileName, &filePointers ); *************** *** 291,294 **** --- 296,302 ---- } catch( const AAFRESULT& hr ) { + if(filePointers.pFile) { + filePointers.pFile->Close(); + } cout << "failed hr = " << hr << endl; return hr; |