QmlProfiler: Fix crash on application exit

The disconnectClient might be called when the last packet
of data arrives, which means we're deleting the connection
while it's readyRead() method is still running. Avoid this
by using deleteLater().

Reviewed-by: Christiaan Janssen
This commit is contained in:
Kai Koehne
2011-04-15 09:35:54 +02:00
parent 18bfabe0ee
commit ea266e33d6

View File

@@ -312,7 +312,9 @@ void QmlProfilerTool::connectToClient()
void QmlProfilerTool::disconnectClient()
{
delete d->m_client;
// this might be actually be called indirectly by QDDConnectionPrivate::readyRead(), therefore allow
// method to complete before deleting object
d->m_client->deleteLater();
d->m_client = 0;
}