Details
Description
When a QScriptEngineDebugger is attached to an QScriptEngine, which is then deleted at some point, the debugger window will crash on close.
attached is a simple program to reproduce this issue.
here is the valgrind backtrace:
==18533== Invalid read of size 8
==18533== at 0x5359832: QScopedPointer<QScriptEngineAgentPrivate, QScopedPointerDeleter<QScriptEngineAgentPrivate> >::data() const (qscopedpointer.h:135)
==18533== by 0x535FAED: QScopedPointer<QScriptEngineAgentPrivate, QScopedPointerDeleter<QScriptEngineAgentPrivate> >::pointer qGetPtrHelper<QScopedPointer<QScriptEngineAgentPrivate, QScopedPointerDeleter<QScriptEngineAgentPrivate> > >(QScopedPointer<QScriptEngineAgentPrivate, QScopedPointerDeleter<QScriptEngineAgentPrivate> > const&) (qglobal.h:2341)
==18533== by 0x535FB0B: QScriptEngineAgent::d_func() const (qscriptengineagent.h:83)
==18533== by 0x535FAA5: QScriptEngineAgent::engine() const (qscriptengineagent.cpp:506)
==18533== by 0x4E6BD49: QScriptDebuggerBackendPrivate::postEvent(QEvent*) (qscriptdebuggerbackend.cpp:157)
==18533== by 0x4E7B4D5: QScriptEngineDebuggerBackend::processCommand(int, QScriptDebuggerCommand const&) (qscriptenginedebuggerfrontend.cpp:204)
==18533== by 0x4E7BBDB: QScriptEngineDebuggerFrontend::processCommand(int, QScriptDebuggerCommand const&) (qscriptenginedebuggerfrontend.cpp:332)
==18533== by 0x4E793C3: QScriptDebuggerFrontendPrivate::processCommands() (qscriptdebuggerfrontend.cpp:134)
==18533== by 0x4E7932B: QScriptDebuggerFrontendPrivate::event(QEvent*) (qscriptdebuggerfrontend.cpp:122)
==18533== by 0x4E7B8FE: QScriptEngineDebuggerFrontendPrivate::event(QEvent*) (qscriptenginedebuggerfrontend.cpp:275)
==18533== by 0x4E79033: QScriptDebuggerFrontendEventReceiver::event(QEvent*) (qscriptdebuggerfrontend.cpp:89)
==18533== by 0x58C89FB: QApplicationPrivate::notify_helper(QObject*, QEvent*) (qapplication.cpp:4481)
==18533== Address 0x8 is not stack'd, malloc'd or (recently) free'd