From 8eeeebafaa66843eb17fc0d0e60154b1de07e183 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Wed, 12 Aug 2009 14:07:51 +0200 Subject: Crash fix. Fix GetSetAgent() in tst_qscriptengine. Reviewed-by: TrustMe --- src/script/api/qscriptengine.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index dfdfdac..8cab92c 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -3533,7 +3533,8 @@ void QScriptEngine::setAgent(QScriptEngineAgent *agent) if (d->agent) QScriptEngineAgentPrivate::get(d->agent)->detach(); d->agent = agent; - QScriptEngineAgentPrivate::get(d->agent)->attach(); + if (agent) + QScriptEngineAgentPrivate::get(d->agent)->attach(); } /*! -- cgit v0.12