We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
When m_msg is empty what() returns a pointer which is out of scope
m_msg
what()
virtual char const * what() const throw() { if (m_msg.empty()) { return m_code.message().c_str(); // temporary goes out of scope } else { return m_msg.c_str(); } }
A possible solution could be:
virtual char const * what() const throw() { if (m_msg.empty()) { m_msg = m_code.message().c_str(); } return m_msg.c_str(); } private: mutable std::string m_msg; // added mutable lib::error_code m_code;
Regards, Fabio
The text was updated successfully, but these errors were encountered:
Fixes out of scope pointer returned from websocketpp::exception::what…
681c233
…(); fixes #397 Also adds unit tests for exception construction
This should be fixed on the develop branch now
Sorry, something went wrong.
The fix for this issue is now present in the 0.5.0 release on the master branch.
No branches or pull requests
When
m_msg
is emptywhat()
returns a pointer which is out of scopeA possible solution could be:
Regards,
Fabio
The text was updated successfully, but these errors were encountered: