The backtrace seems to indicate that when the VU meter CO was set by the engine, the CDP then rebroadcasted the valueChanged signal to a COSlave that was concurrently being deleted by the main thread. That's consistent with changing the skin since the VU meter CO slave was just deleted. I suspect if Daniel had posted a backtrace of all threads we would see that the main thread was in the middle of ~WVuMeter.
(I'm not sure what smart pointers would tell you here? In this particular case, the control is held by ControlWidgetConnection and it's a ControlObjectSlave wrapped in a QScopedPointer)
So, shoot. That's a legit race condition.
Using an AutoConnection for CDP <-> COSlave signals would solve the issue for COSlaves that are deleted from the main thread. But if a CO slave's life cycle is not controlled by the main thread and that thread does not have a Qt event loop then we're kind of stuck.
One option is to use QObject::deleteLater for COSlaves. But if a COSlave is not created in the main thread then it won't be deleted until that thread ends. We could moveToThread(mainThread) and then call deleteLater? Thoughts?
The backtrace seems to indicate that when the VU meter CO was set by the engine, the CDP then rebroadcasted the valueChanged signal to a COSlave that was concurrently being deleted by the main thread. That's consistent with changing the skin since the VU meter CO slave was just deleted. I suspect if Daniel had posted a backtrace of all threads we would see that the main thread was in the middle of ~WVuMeter.
(I'm not sure what smart pointers would tell you here? In this particular case, the control is held by ControlWidgetCo nnection and it's a ControlObjectSlave wrapped in a QScopedPointer)
So, shoot. That's a legit race condition.
Using an AutoConnection for CDP <-> COSlave signals would solve the issue for COSlaves that are deleted from the main thread. But if a CO slave's life cycle is not controlled by the main thread and that thread does not have a Qt event loop then we're kind of stuck.
One option is to use QObject: :deleteLater for COSlaves. But if a COSlave is not created in the main thread then it won't be deleted until that thread ends. We could moveToThread( mainThread) and then call deleteLater? Thoughts?