Allow local-scope strings to be passed in as constructor parameters.
authorCarl Hetherington <carl@carlh.net>
Sat, 7 Aug 2010 23:30:12 +0000 (23:30 +0000)
committerCarl Hetherington <carl@carlh.net>
Sat, 7 Aug 2010 23:30:12 +0000 (23:30 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@7559 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/audioengine.h

index fcbe6d3514d7f0970dd7dc60d038548945ccc93f..0226e232823ff9049785bc1e4aa753e65dc802e8 100644 (file)
@@ -135,13 +135,15 @@ class AudioEngine : public SessionHandlePtr
 
        class PortRegistrationFailure : public std::exception {
        public:
-               PortRegistrationFailure (const char* why = "") {
-                       reason = why;
-               }
-               virtual const char *what() const throw() { return reason; }
+               PortRegistrationFailure (std::string const & why = "")
+                       : reason (why) {}
+
+               ~PortRegistrationFailure () throw () {}
+
+               virtual const char *what() const throw () { return reason.c_str(); }
 
        private:
-               const char* reason;
+               std::string reason;
        };
 
        class NoBackendAvailable : public std::exception {