SMF::end_write() is a no-op if there is no _smf structure
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 21 Apr 2015 02:46:39 +0000 (22:46 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 21 Apr 2015 02:46:39 +0000 (22:46 -0400)
libs/evoral/src/SMF.cpp

index c4e06823a9c606fee540549d14a7bd4aa5eb27b3..b6ec8ecba73bb2e6085f8cf500b2ba42ff853aac 100644 (file)
@@ -400,6 +400,11 @@ void
 SMF::end_write(string const & path) THROW_FILE_ERROR
 {
        Glib::Threads::Mutex::Lock lm (_smf_lock);
+
+       if (!_smf) {
+               return;
+       }
+
        FILE* f = fopen (path.c_str(), "w+");
        if (f == 0) {
                throw FileError (path);