Hi,

I'm developing an application that contains 2 QThreads, one is the Producer and the other is the Consumer that have a ring buffer.

The ring buffer is an array of objects.

The Consumer does somethings on the object that is accessing and finally emits a signal with a pointer to that data to the Main Thread. The Main Thread takes the object(that is a pointer) and paints it's representation.

I'm emitting pointers instead of objects to speed up the application.

The problem is that when the Main Thread access to the data pointer, maybe it's being cleared(or filled) by the producer and then the application crash.

Is there any way to know if the memory pointer don't contains data?

I would like that Main Thread don't do anything if there is no real data.

Thanks,