no need to close a file that will not be removed (and has no name)
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 29 Apr 2015 19:01:28 +0000 (15:01 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 29 Apr 2015 19:01:33 +0000 (15:01 -0400)
libs/audiographer/audiographer/sndfile/tmp_file.h

index 8ea676c0d589a7b7247086f47eb31bc42cd0bc0e..24caf5a723bf2a4ad1b13a8ca839879e16d440f0 100644 (file)
@@ -37,8 +37,8 @@ class TmpFile : public SndfileWriter<T>, public SndfileReader<T>
                /* explicitly close first, some OS (yes I'm looking at you windows)
                 * cannot delet files that are still open
                 */
-               SndfileBase::close();
                if (!filename.empty()) {
+                       SndfileBase::close();
                        std::remove(filename.c_str());
                }
        }