forked from qt-creator/qt-creator
QmlDebug: Fix crash on app closing
Make sure that the engineClient object is the parent of all of its queries, since the destructor of a query might try to access the client ... Reviewed-by: Christiaan Janssen Task-number: QTCREATORBUG-4105
This commit is contained in:
@@ -306,7 +306,7 @@ bool ClientProxy::resetBindingForObject(int objectDebugId, const QString& proper
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QDeclarativeDebugExpressionQuery *ClientProxy::queryExpressionResult(int objectDebugId, const QString &expr, QObject *parent)
|
QDeclarativeDebugExpressionQuery *ClientProxy::queryExpressionResult(int objectDebugId, const QString &expr)
|
||||||
{
|
{
|
||||||
if (objectDebugId == -1)
|
if (objectDebugId == -1)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -317,7 +317,8 @@ QDeclarativeDebugExpressionQuery *ClientProxy::queryExpressionResult(int objectD
|
|||||||
bool block = m_adapter->disableJsDebugging(true);
|
bool block = m_adapter->disableJsDebugging(true);
|
||||||
|
|
||||||
log(LogSend, QString("EVAL_EXPRESSION %1 %2").arg(QString::number(objectDebugId), expr));
|
log(LogSend, QString("EVAL_EXPRESSION %1 %2").arg(QString::number(objectDebugId), expr));
|
||||||
QDeclarativeDebugExpressionQuery *query = m_engineClient->queryExpressionResult(objectDebugId,expr,parent);
|
QDeclarativeDebugExpressionQuery *query
|
||||||
|
= m_engineClient->queryExpressionResult(objectDebugId, expr, m_engineClient);
|
||||||
|
|
||||||
m_adapter->disableJsDebugging(block);
|
m_adapter->disableJsDebugging(block);
|
||||||
return query;
|
return query;
|
||||||
@@ -348,7 +349,7 @@ bool ClientProxy::addObjectWatch(int objectDebugId)
|
|||||||
// is flooding the debugging output log!
|
// is flooding the debugging output log!
|
||||||
// log(LogSend, QString("WATCH_PROPERTY %1").arg(objectDebugId));
|
// log(LogSend, QString("WATCH_PROPERTY %1").arg(objectDebugId));
|
||||||
|
|
||||||
QDeclarativeDebugWatch *watch = m_engineClient->addWatch(ref, this);
|
QDeclarativeDebugWatch *watch = m_engineClient->addWatch(ref, m_engineClient);
|
||||||
m_objectWatches.insert(objectDebugId, watch);
|
m_objectWatches.insert(objectDebugId, watch);
|
||||||
|
|
||||||
connect(watch,SIGNAL(valueChanged(QByteArray,QVariant)),this,SLOT(objectWatchTriggered(QByteArray,QVariant)));
|
connect(watch,SIGNAL(valueChanged(QByteArray,QVariant)),this,SLOT(objectWatchTriggered(QByteArray,QVariant)));
|
||||||
@@ -412,7 +413,8 @@ void ClientProxy::queryEngineContext(int id)
|
|||||||
|
|
||||||
log(LogSend, QString("LIST_OBJECTS %1").arg(QString::number(id)));
|
log(LogSend, QString("LIST_OBJECTS %1").arg(QString::number(id)));
|
||||||
|
|
||||||
m_contextQuery = m_engineClient->queryRootContexts(QDeclarativeDebugEngineReference(id), this);
|
m_contextQuery = m_engineClient->queryRootContexts(QDeclarativeDebugEngineReference(id),
|
||||||
|
m_engineClient);
|
||||||
if (!m_contextQuery->isWaiting())
|
if (!m_contextQuery->isWaiting())
|
||||||
contextChanged();
|
contextChanged();
|
||||||
else
|
else
|
||||||
@@ -446,7 +448,8 @@ void ClientProxy::fetchContextObjectRecursive(const QDeclarativeDebugContextRefe
|
|||||||
|
|
||||||
log(LogSend, QString("FETCH_OBJECT %1").arg(obj.idString()));
|
log(LogSend, QString("FETCH_OBJECT %1").arg(obj.idString()));
|
||||||
|
|
||||||
QDeclarativeDebugObjectQuery* query = m_engineClient->queryObjectRecursive(obj, this);
|
QDeclarativeDebugObjectQuery* query
|
||||||
|
= m_engineClient->queryObjectRecursive(obj, m_engineClient);
|
||||||
if (!query->isWaiting()) {
|
if (!query->isWaiting()) {
|
||||||
query->deleteLater(); //ignore errors;
|
query->deleteLater(); //ignore errors;
|
||||||
} else {
|
} else {
|
||||||
@@ -632,7 +635,7 @@ void ClientProxy::reloadEngines()
|
|||||||
|
|
||||||
log(LogSend, QString("LIST_ENGINES"));
|
log(LogSend, QString("LIST_ENGINES"));
|
||||||
|
|
||||||
m_engineQuery = m_engineClient->queryAvailableEngines(this);
|
m_engineQuery = m_engineClient->queryAvailableEngines(m_engineClient);
|
||||||
if (!m_engineQuery->isWaiting()) {
|
if (!m_engineQuery->isWaiting()) {
|
||||||
updateEngineList();
|
updateEngineList();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public:
|
|||||||
|
|
||||||
bool setMethodBodyForObject(int objectDebugId, const QString &methodName, const QString &methodBody);
|
bool setMethodBodyForObject(int objectDebugId, const QString &methodName, const QString &methodBody);
|
||||||
bool resetBindingForObject(int objectDebugId, const QString &propertyName);
|
bool resetBindingForObject(int objectDebugId, const QString &propertyName);
|
||||||
QDeclarativeDebugExpressionQuery *queryExpressionResult(int objectDebugId, const QString &expr, QObject *parent=0);
|
QDeclarativeDebugExpressionQuery *queryExpressionResult(int objectDebugId, const QString &expr);
|
||||||
void clearComponentCache();
|
void clearComponentCache();
|
||||||
|
|
||||||
bool addObjectWatch(int objectDebugId);
|
bool addObjectWatch(int objectDebugId);
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ void InspectorUi::showDebuggerTooltip(const QPoint &mousePos, TextEditor::ITextE
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!query.isEmpty()) {
|
if (!query.isEmpty()) {
|
||||||
m_debugQuery = m_clientProxy->queryExpressionResult(ref.debugId(),query, this);
|
m_debugQuery = m_clientProxy->queryExpressionResult(ref.debugId(), query);
|
||||||
connect(m_debugQuery, SIGNAL(stateChanged(QDeclarativeDebugQuery::State)),
|
connect(m_debugQuery, SIGNAL(stateChanged(QDeclarativeDebugQuery::State)),
|
||||||
this, SLOT(debugQueryUpdated(QDeclarativeDebugQuery::State)));
|
this, SLOT(debugQueryUpdated(QDeclarativeDebugQuery::State)));
|
||||||
}
|
}
|
||||||
@@ -630,7 +630,7 @@ void InspectorUi::selectItems(const QList<int> &objectIds)
|
|||||||
void InspectorUi::changePropertyValue(int debugId,const QString &propertyName, const QString &valueExpression)
|
void InspectorUi::changePropertyValue(int debugId,const QString &propertyName, const QString &valueExpression)
|
||||||
{
|
{
|
||||||
QString query = propertyName + '=' + valueExpression;
|
QString query = propertyName + '=' + valueExpression;
|
||||||
m_clientProxy->queryExpressionResult(debugId, query, this);
|
m_clientProxy->queryExpressionResult(debugId, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InspectorUi::enable()
|
void InspectorUi::enable()
|
||||||
|
|||||||
Reference in New Issue
Block a user