From 66aeda8d8ad1f029232888ab823623da9615fb3c Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 7 Aug 2010 23:30:12 +0000 Subject: [PATCH] Allow local-scope strings to be passed in as constructor parameters. git-svn-id: svn://localhost/ardour2/branches/3.0@7559 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/audioengine.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h index fcbe6d3514..0226e23282 100644 --- a/libs/ardour/ardour/audioengine.h +++ b/libs/ardour/ardour/audioengine.h @@ -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 {