Update of /cvsroot/audacity/audacity-src/src/import
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv29639

Modified Files:
        ImportFLAC.cpp 
Log Message:
Apply patch from Dan Horgan to fix attempted double close of file.


Index: ImportFLAC.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/import/ImportFLAC.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- ImportFLAC.cpp      23 Mar 2009 00:32:54 -0000      1.34
+++ ImportFLAC.cpp      25 Apr 2009 23:08:28 -0000      1.35
@@ -329,7 +329,13 @@
    // Even though there is an init() method that takes a filename, use the one 
that
    // takes a file handle because wxWidgets can open a file with a Unicode 
name and
    // libflac can't (under Windows).
-   if (mFile->init(mHandle.fp()) != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
+   //
+   // Responsibility for closing the file is passed to libflac.
+   // (it happens when mFile->finish() is called)
+   bool result = mFile->init(mHandle.fp());
+   mHandle.Detach();
+
+   if (result != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
       return false;
    }
 #endif
@@ -443,8 +449,6 @@
 {
    mFile->finish();
    delete mFile;
-
-   mHandle.Close();
 }
 
 #endif /* USE_LIBFLAC */


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to