From eeb70797cfcafb081dc758d17871e77ec0784037 Mon Sep 17 00:00:00 2001 From: Henri Herscher Date: Thu, 18 May 2006 19:34:45 +0000 Subject: Now checks for null pointer before trying to close and delete files in exception handler (was crash prone) git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@237 09dcff7a-b715-0410-9601-b79a96267cd0 --- orkaudio/BatchProcessing.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/orkaudio/BatchProcessing.cpp b/orkaudio/BatchProcessing.cpp index 0b5ad4d..6fb3fa5 100644 --- a/orkaudio/BatchProcessing.cpp +++ b/orkaudio/BatchProcessing.cpp @@ -275,13 +275,13 @@ void BatchProcessing::ThreadHandler(void *args) catch (CStdString& e) { LOG4CXX_ERROR(LOG.batchProcessingLog, CStdString("Th") + threadIdString + " " + e); - fileRef->Close(); - outFileRef->Close(); + if(fileRef.get()) {fileRef->Close();} + if(outFileRef.get()) {outFileRef->Close();} if(CONFIG.m_deleteFailedCaptureFile && fileRef.get() != NULL) { LOG4CXX_INFO(LOG.batchProcessingLog, CStdString("Th") + threadIdString + " deleting native and transcoded"); - fileRef->Delete(); - outFileRef->Delete(); + if(fileRef.get()) {fileRef->Delete();} + if(outFileRef.get()) {outFileRef->Delete();} } } //catch(...) -- cgit v1.2.3