[mythtv] [mythtv-commits] Ticket #1272: preview or lcd qsocket related segfault

Isaac Richards ijr at case.edu
Fri Mar 31 22:08:30 UTC 2006


On Friday 31 March 2006 17:04, Jim Westfall wrote:
> Looking at it while bored at work I think the following code is the
> trigger in lcddevice.cpp.
>
> os << someText << "\n" << flush;
>
> There is a race between QSocket::flush() via a QSocketNotifier event and
> this forced flush().
>
> I think the easy fix it to change
>
> QTextStream os(socket);
>
> to
>
> QTextStream os(socket->socketDevice());
>
> so QTextStream is directly writing to the QSocketDevice and bypassing the
> thread-unsafe QSocket buffering.

I've seen issues (random crashing) before when just using the QSocket's 
QSocketDevice.  Only way to really fix it is not to use QSocket.

Isaac


More information about the mythtv-dev mailing list