show correct exceptions: fix exception memory access bug
This commit is contained in:
@@ -16,8 +16,9 @@ class Exception: public std::exception {
|
||||
Exception(QString w): _what(w) {}
|
||||
~Exception() throw() {}
|
||||
const char* what() const throw() {
|
||||
_bytes = _what.toUtf8();
|
||||
return _bytes.data();
|
||||
static QByteArray bytes;
|
||||
bytes = _what.toUtf8();
|
||||
return bytes.data();
|
||||
}
|
||||
void line(int linenr) {
|
||||
if (linenr>0) _what=QString::number(linenr)+" "+_what;
|
||||
@@ -26,7 +27,6 @@ class Exception: public std::exception {
|
||||
if (filename.size()) _what=filename+":"+_what;
|
||||
}
|
||||
protected:
|
||||
QByteArray _bytes;
|
||||
QString _what;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user