Fix dangling pointer smuggling in PreviewModelException

This commit is contained in:
Tamás Bálint Misius 2021-05-22 14:53:45 +02:00
parent 2c207a934e
commit d8e641b977
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2

View File

@ -6,12 +6,12 @@
struct PreviewModelException: public std::exception
{
String message;
ByteString message;
public:
PreviewModelException(String message_): message(message_) {}
PreviewModelException(String message_): message(message_.ToUtf8()) {}
const char * what() const throw() override
{
return message.ToUtf8().c_str();
return message.c_str();
}
~PreviewModelException() throw() {}
};