From b8e6f86ed8b27504f22da2167cb6aa9ecf829a71 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Tue, 8 Sep 2009 14:03:05 +0200 Subject: QScriptDebuggerBackend crash fix. QScriptDebuggerBackend::contextCount() method was trying to count number of context push & pop and result was not equal to elements count in QScriptDebuggerBackend::contextIds() list. Patch change QScriptDebuggerBackend::contextCount() to call count() on ids list. Task-number: 260719 Reviewed-by: Kent Hansen --- src/scripttools/debugging/qscriptdebuggerbackend.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/scripttools/debugging/qscriptdebuggerbackend.cpp b/src/scripttools/debugging/qscriptdebuggerbackend.cpp index 2efff04..feaea63 100644 --- a/src/scripttools/debugging/qscriptdebuggerbackend.cpp +++ b/src/scripttools/debugging/qscriptdebuggerbackend.cpp @@ -805,13 +805,7 @@ int QScriptDebuggerBackend::contextCount() const { if (!engine()) return 0; - int count = 0; - QScriptContext *ctx = engine()->currentContext(); - while (ctx) { - ++count; - ctx = ctx->parentContext(); - } - return count; + return contextIds().count(); } /*! -- cgit v0.12