I have a custom-built player which can "play" recoded media samples (sensor data with timestamps).
What I am trying to do is couple this player to an Qt UI. I have created a Widget and coupled the Player and the Widget through Signals and slots (Qt::DirectConnection).
The problem I'm experiencing is that the program crashes with an exception thrown. The moment when it crashes is completely random, and sometimes it may not crash. As far as I can tell, the problem lies in that the update in the widget part is not thread-safe. I have tried restricting access to it with a binary semaphore (immediately return if semaphore true, continue if not). The error still doesn't go away.
My question is: is the Qt Painter running on the same thread as the Widget updater? I suspect I'm calling the painter before the previous paint operation has finished, which is why it still crashes. I suspect the widget only somehow posts an event to the painter (non-blocking)..
What else could be the problem? Unfortunately, the code is too complex to paste here. However, I am attaching a screenshot of the crash.
Cheers, Mihai