Exception's what() return invalid pointer.
Status: Pre-Alpha
Brought to you by:
darkschneider2
Exceptions do all return an invalid pointer to a temporary object in their what() method.
Example:
const char* PacketErrorException::what() const throw()
{
string str = "PacketErrorException: " + my_reason;
return (const char*)str.c_str();
}
Possible solution:
Construct the message string already in the constructors, the return value lives as long as the exception.