Use PBD::copy_file in Session::create() to copy the template file.
[ardour.git] / libs / ardour / session_butler.cc
index 6c3fdea7e6846e903a95e21240834aa2cfa045cb..afb284b0f49a4ab549eee18002894b8929c11e2f 100644 (file)
@@ -103,10 +103,12 @@ Session::start_butler_thread ()
 void
 Session::terminate_butler_thread ()
 {
-       void* status;
-       char c = ButlerRequest::Quit;
-       ::write (butler_request_pipe[1], &c, 1);
-       pthread_join (butler_thread, &status);
+       if (butler_thread) {
+               void* status;
+               char c = ButlerRequest::Quit;
+               ::write (butler_request_pipe[1], &c, 1);
+               pthread_join (butler_thread, &status);
+       }
 }
 
 void
@@ -246,7 +248,7 @@ Session::butler_thread_work ()
                gettimeofday (&begin, 0);
 
                boost::shared_ptr<DiskstreamList> dsl = diskstreams.reader ();
-               
+
                for (i = dsl->begin(); !transport_work_requested() && butler_should_run && i != dsl->end(); ++i) {
 
                        boost::shared_ptr<Diskstream> ds = *i;