[flext] segfault on destroying multi-threaded object

Spencer Russell spencer.f.russell at gmail.com
Sun Oct 2 20:40:15 CEST 2011


I've got a flext object that spawns a thread that polls a USB device
and uses ToOutList to send the received data on an outlet.

I'm getting an issue where the QWork thread is segfaulting when I kill
the object. It looks like the object's destructor gets called after
the polling thread has put a message in the message queue (QWork
thread), but before the message has actually been spit out of the
outlet. This means that when the QWork thread gets around to sending
the message, it segfaults looking for an outlet on an object that
doesn't exist.

My destructor waits for my polling thread to finish before it exits,
but it doesn't know about the QWork thread so it can't wait on that.

Am I doing something wrong, or is this a bug in flext's multithreading?

backtrace: https://gist.github.com/1257739

code: https://github.com/ssfrr/libmanta/tree/multimanta/


More information about the flext mailing list