forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user