diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-06-01 15:16:01 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-01 15:19:21 +0200 |
commit | 0a4e802f182e6e4b3c54cafa141c8d07ec7621f6 (patch) | |
tree | fb33de7ec10f5d2c4a9734d6a796dfbc5a221d97 /src/scripttools/debugging | |
parent | 4b8f98af134e188b8915dd8fb5d61275d834cfd0 (diff) | |
download | qtscript-0a4e802f182e6e4b3c54cafa141c8d07ec7621f6.tar.gz |
Don't crash in debugger if QScriptEngine is deleted
Task-number: QTBUG-21548
Change-Id: I925a920c8685cf4cf40c7ad03c2d519e2f2121fb
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'src/scripttools/debugging')
-rw-r--r-- | src/scripttools/debugging/qscriptdebuggerbackend.cpp | 1 | ||||
-rw-r--r-- | src/scripttools/debugging/qscriptenginedebuggerfrontend.cpp | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/scripttools/debugging/qscriptdebuggerbackend.cpp b/src/scripttools/debugging/qscriptdebuggerbackend.cpp index adc1410..63dcf75 100644 --- a/src/scripttools/debugging/qscriptdebuggerbackend.cpp +++ b/src/scripttools/debugging/qscriptdebuggerbackend.cpp @@ -154,6 +154,7 @@ void QScriptDebuggerBackendPrivate::postEvent(QEvent *e) { if (!eventReceiver) { eventReceiver = new QScriptDebuggerBackendEventReceiver(this); + Q_ASSERT(agent != 0); eventReceiver->moveToThread(agent->engine()->thread()); } QCoreApplication::postEvent(eventReceiver, e); diff --git a/src/scripttools/debugging/qscriptenginedebuggerfrontend.cpp b/src/scripttools/debugging/qscriptenginedebuggerfrontend.cpp index 8b08e4c..d1b881c 100644 --- a/src/scripttools/debugging/qscriptenginedebuggerfrontend.cpp +++ b/src/scripttools/debugging/qscriptenginedebuggerfrontend.cpp @@ -201,7 +201,8 @@ QScriptEngineDebuggerBackend::~QScriptEngineDebuggerBackend() void QScriptEngineDebuggerBackend::processCommand(int id, const QScriptDebuggerCommand &command) { Q_D(QScriptEngineDebuggerBackend); - d->postEvent(new QScriptDebuggerCommandEvent(id, command)); + if (d->agent) + d->postEvent(new QScriptDebuggerCommandEvent(id, command)); } /*! |