X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fsession_butler.cc;h=afb284b0f49a4ab549eee18002894b8929c11e2f;hb=c7e404a1c0ee9af941a335e4bdd2f667b0c6317a;hp=6c3fdea7e6846e903a95e21240834aa2cfa045cb;hpb=c268314b64c2235b0d69c3854e303accd2cad4d9;p=ardour.git diff --git a/libs/ardour/session_butler.cc b/libs/ardour/session_butler.cc index 6c3fdea7e6..afb284b0f4 100644 --- a/libs/ardour/session_butler.cc +++ b/libs/ardour/session_butler.cc @@ -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 dsl = diskstreams.reader (); - + for (i = dsl->begin(); !transport_work_requested() && butler_should_run && i != dsl->end(); ++i) { boost::shared_ptr ds = *i;