So it's a bit complicated but I will do my best to explain my problem.

I am developping some classes to read/write data over a serial port. I am using the Win_QextSerialPort class (and its base class) that can be found on sourceforge. The only thing I'll tell about this class is that it uses in quite every function the QMutex lock/unlock mechanism.

So, go on, I ddi developp a class called CSerialDataFrameDecoder which uses the Win_QextSerialPort. Mt class inherits from QThread and reimplements the run() method in which I keep reading the serial port buffer and process its data. The process is quite simple, I am looking for some start and stop sequence and create some CSerialDataFrame (it is a class I did developp too). Once a CSerialDataFrame is created I post a custom event to object owner of the CSerialDataFrameDecoder. At the beginning I wished to use the signals/slots mechanism but it is not possible with threads. To test my classes I developped a simple GUI application which reimplements the customEvent function and just display the content of the CSerialDataFrame contained in my custom event. This test application works fine in debug version but it sometime crashes in release version (access violation) ... this is my first problem, but I decided to focus on that problem later on (also because I don't really know how to find out the origin of this problem) because the debug version works.

After that I decided to developp another class called CSerialPort which inherits from QObject. This class encapsulates the CSerialDataFrameDecoder, stores all CSerialDataFrame into a stack and posts a custom event when it receives a custom event from the CSerialDataFrameDecoder. This class has at least two functions start and stop which respectively starts and stops the CSerialDataFrameDecoder thread. I also developp a GUI test application with a reimplentation of the function customEvent which displays the CSerialDataFrame content using a QListBox object. Here is my second problem because the application blocks, it does not bug or crashes, it just blocks so I must stop and start the CSerialDataFrameDecoder. The application never blocks at the same time and I don't know how to find out the problem.

If someone have a clue to the answer (even the answer itself) ... thanks in advance.