Use PBD::copy_file in Session::create() to copy the template file.
[ardour.git] / libs / ardour / control_protocol_manager.cc
index 899790dddc75f8156d0f908791b98ed66cafeadc..00c05b280039fef867b74767bd9f1700f65ebee1 100644 (file)
@@ -1,3 +1,22 @@
+/*
+    Copyright (C) 2000-2007 Paul Davis 
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
 #include <dlfcn.h>
 
 #include <pbd/compose.h>
@@ -77,7 +96,10 @@ ControlProtocolManager::drop_session ()
                
                for (list<ControlProtocolInfo*>::iterator p = control_protocol_info.begin(); p != control_protocol_info.end(); ++p) {
                        // otherwise the ControlProtocol instances are not recreated in set_session
-                       (*p)->requested = true;
+                       if ((*p)->protocol) {
+                               (*p)->requested = true;
+                               (*p)->protocol = 0;
+                       }
                }
        }
 }