Index: libs/ardour/ardour/session.h
===================================================================
--- libs/ardour/ardour/session.h	(revision 1479)
+++ libs/ardour/ardour/session.h	(working copy)
@@ -1118,6 +1118,7 @@
 	Sample*           butler_mixdown_buffer;
 	float*            butler_gain_buffer;
 	pthread_t         butler_thread;
+	bool              butler_thread_started;
 	Glib::Mutex       butler_request_lock;
         Glib::Cond        butler_paused;
 	bool              butler_should_run;
@@ -1370,6 +1371,7 @@
 
 	Glib::Mutex       midi_lock;
 	pthread_t       midi_thread;
+	bool            midi_thread_started;
 	int             midi_request_pipe[2];
 	mutable  gint   butler_active;
 	RingBuffer<MIDIRequest*> midi_requests;
Index: libs/ardour/session_midi.cc
===================================================================
--- libs/ardour/session_midi.cc	(revision 1479)
+++ libs/ardour/session_midi.cc	(working copy)
@@ -1091,6 +1091,8 @@
 		return -1;
 	}
 
+	midi_thread_started = true;
+
 	// pthread_detach (midi_thread);
 
 	return 0;
@@ -1099,6 +1101,10 @@
 void
 Session::terminate_midi_thread ()
 {
+	if (midi_thread_started == false) {
+		return;
+	}
+  
 	MIDIRequest* request = new MIDIRequest;
 	void* status;
 
@@ -1108,6 +1114,7 @@
 	poke_midi_thread ();
 
 	pthread_join (midi_thread, &status);
+	midi_thread_started = false;
 }
 
 void
Index: libs/ardour/session_butler.cc
===================================================================
--- libs/ardour/session_butler.cc	(revision 1479)
+++ libs/ardour/session_butler.cc	(working copy)
@@ -98,16 +98,24 @@
 
 	// pthread_detach (butler_thread);
 
+	butler_thread_started = true;
+
 	return 0;
 }
 
 void
 Session::terminate_butler_thread ()
 {
+	if (butler_thread_started == false) {
+        	return;
+	}
+	
 	void* status;
 	char c = ButlerRequest::Quit;
 	::write (butler_request_pipe[1], &c, 1);
 	pthread_join (butler_thread, &status);
+
+	butler_thread_started = false;
 }
 
 void
Index: libs/ardour/session.cc
===================================================================
--- libs/ardour/session.cc	(revision 1479)
+++ libs/ardour/session.cc	(working copy)
@@ -262,6 +262,8 @@
 	  _mtc_port (default_mtc_port),
 	  _midi_port (default_midi_port),
 	  pending_events (2048),
+	  butler_thread_started(false),
+	  midi_thread_started(false),
 	  midi_requests (128), // the size of this should match the midi request pool size
 	  diskstreams (new DiskstreamList),
 	  routes (new RouteList),
@@ -281,7 +283,6 @@
 	new_session = !g_file_test (_path.c_str(), GFileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR));
 	if (new_session) {
 		if (create (new_session, mix_template, compute_initial_length())) {
-			cerr << "create failed\n";
 			destroy ();
 			throw failed_constructor ();
 		}
@@ -321,6 +322,8 @@
 	  _mtc_port (default_mtc_port),
 	  _midi_port (default_midi_port),
 	  pending_events (2048),
+	  butler_thread_started(false),
+	  midi_thread_started(false),
 	  midi_requests (16),
 	  diskstreams (new DiskstreamList),
 	  routes (new RouteList),



