why is this not working? I do the usual PostEvent call to update the UI from another thread. It works perfectly until I comment free(buffer) back in. The destructor is called by the system (I assume after event() has consumed the event) but trying to free the buffer causes an access violation. leaving it out causes memory leaks.

Qt Code:
  1. class FrameEvent : public QEvent
  2. {
  3. public:
  4. FrameEvent() : QEvent(QEvent::Type::User) {}
  5.  
  6. ~FrameEvent()
  7. {
  8. free(buffer);
  9. }
  10. unsigned char * buffer;
  11. };
To copy to clipboard, switch view to plain text mode