Skip to content

Commit 547b050

Browse files
michaelsafyanzbjornson
authored andcommittedFeb 27, 2021
Fix dangling reference in BackendOperationNotAvailable exception.
1 parent beaee39 commit 547b050

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed
 

‎src/backend/Backend.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ BackendOperationNotAvailable::BackendOperationNotAvailable(Backend* backend,
9999
std::string operation_name)
100100
: backend(backend)
101101
, operation_name(operation_name)
102-
{};
102+
{
103+
msg = "operation " + operation_name +
104+
" not supported by backend " + backend->getName();
105+
};
103106

104107
BackendOperationNotAvailable::~BackendOperationNotAvailable() throw() {};
105108

106109
const char* BackendOperationNotAvailable::what() const throw()
107110
{
108-
std::string msg = "operation " + this->operation_name +
109-
" not supported by backend " + backend->getName();
110-
111111
return msg.c_str();
112112
};

‎src/backend/Backend.h

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class BackendOperationNotAvailable: public std::exception
5959
private:
6060
Backend* backend;
6161
std::string operation_name;
62+
std::string msg;
6263

6364
public:
6465
BackendOperationNotAvailable(Backend* backend, std::string operation_name);

0 commit comments

Comments
 (0)
Please sign in to comment.