[Kwintv] V4L plugin crash solved...

Dirk Ziegelmeier dziegel at gmx.de
Sun Jan 4 09:47:02 CET 2004


On Sunday 04 January 2004 01:21, Dirk Ziegelmeier wrote:
> So the following situation can happen: During the deletion, the grabber
The explanation wasn't quite right, it was too late in the night.

Objet deletion starts. Thread change, the grabber thread aquires the Qt Lib 
Mutex because it's not locked during destruction, checks for _stop (still 
false). Thread change, deletion continues, _stop is set to true, the TV 
widget and the grabber thread is deleted. Thread change, the grabber thread 
starts (or continues) to paint to the deleted widget with the deleted buffer.

A solution would also be to wait for thread termination in ~V4LGrabber, but 
this will deadlock when the video plugin is destroyed during normal operation 
(e.g. when changing to the XVIDEO plugin) because thread termination depends 
on an unlocked Qt Lib Mutex.

There is still something that may cause a crash: the Grabber thread calls 
deleteLater() as last operation. What will happen if QApplication is 
completely destroyed when this is called?

Dirk


More information about the kwintv mailing list