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 account linked to committer's email address

View File

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