forked from qt-creator/qt-creator
QmlDesigner: Fix crash when 'Debug QML emulation layer' is enabled
Timer was accessed before creation in this case. Change-Id: I8817043f1a875cb4c7c6cf8a1f4b398f78058509 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -101,7 +101,7 @@ void InteractiveConnectionManager::dispatchCommand(const QVariant &command, Conn
|
||||
|
||||
void InteractiveConnectionManager::puppetTimeout(Connection &connection)
|
||||
{
|
||||
if (connection.socket && connection.socket->waitForReadyRead(10)) {
|
||||
if (connection.timer && connection.socket && connection.socket->waitForReadyRead(10)) {
|
||||
connection.timer->stop();
|
||||
connection.timer->start();
|
||||
return;
|
||||
@@ -112,8 +112,10 @@ void InteractiveConnectionManager::puppetTimeout(Connection &connection)
|
||||
|
||||
void InteractiveConnectionManager::puppetAlive(Connection &connection)
|
||||
{
|
||||
connection.timer->stop();
|
||||
connection.timer->start();
|
||||
if (connection.timer) {
|
||||
connection.timer->stop();
|
||||
connection.timer->start();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
||||
Reference in New Issue
Block a user