aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/debugger/qv8debugservice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/debugger/qv8debugservice.cpp')
-rw-r--r--src/qml/debugger/qv8debugservice.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/qml/debugger/qv8debugservice.cpp b/src/qml/debugger/qv8debugservice.cpp
index 9045b4b50e..575097f829 100644
--- a/src/qml/debugger/qv8debugservice.cpp
+++ b/src/qml/debugger/qv8debugservice.cpp
@@ -148,12 +148,18 @@ QV8DebugService *QV8DebugService::instance()
return v8ServiceInstance();
}
-void QV8DebugService::initialize(const QV8Engine *engine)
+void QV8DebugService::addEngine(const QV8Engine *engine)
{
// just make sure that the service is properly registered
v8ServiceInstance()->setEngine(engine);
}
+void QV8DebugService::removeEngine(const QV8Engine *engine)
+{
+ if (v8ServiceInstance()->d_func()->engine == engine)
+ v8ServiceInstance()->setEngine(0);
+}
+
void QV8DebugService::setEngine(const QV8Engine *engine)
{
Q_D(QV8DebugService);
@@ -280,7 +286,8 @@ void QV8DebugService::processDebugMessages()
{
Q_D(QV8DebugService);
v8::HandleScope handleScope;
- v8::Context::Scope contextScope(d->engine->context());
+ if (d->engine)
+ v8::Context::Scope contextScope(d->engine->context());
v8::Debug::ProcessDebugMessages();
}