comparison data/midi/MIDIEvent.h @ 1848:98339fac0faf

Avoid returning expired pointers
author Chris Cannam
date Thu, 23 Apr 2020 15:39:08 +0100
parents c3b5564cfb78
children
comparison
equal deleted inserted replaced
1847:9762a7f084a0 1848:98339fac0faf
226 << message.toLocal8Bit().data() << std::endl; 226 << message.toLocal8Bit().data() << std::endl;
227 } 227 }
228 virtual ~MIDIException() throw() { } 228 virtual ~MIDIException() throw() { }
229 229
230 const char *what() const throw() override { 230 const char *what() const throw() override {
231 return m_message.toLocal8Bit().data(); 231 static QByteArray msg;
232 msg = m_message.toLocal8Bit();
233 return msg.data();
232 } 234 }
233 235
234 protected: 236 protected:
235 QString m_message; 237 QString m_message;
236 }; 238 };