diff --git a/src/tools/ecode/plugins/debugger/debuggerclientlistener.cpp b/src/tools/ecode/plugins/debugger/debuggerclientlistener.cpp index f30d2550d..e83b0e254 100644 --- a/src/tools/ecode/plugins/debugger/debuggerclientlistener.cpp +++ b/src/tools/ecode/plugins/debugger/debuggerclientlistener.cpp @@ -497,6 +497,8 @@ void DebuggerClientListener::scopes( const int /*frameId*/, std::vector&& uiVars->removeActionsByTag( SCOPES_UI_HASH ); uiVars->runOnMainThread( [this, uiVars] { + // Reset selection given that the VariablesModel can end up doing an use-after-free + uiVars->getSelection().clear(); auto model = uiVars->getModel(); size_t total = model->rowCount(); for ( size_t i = 0; i < total; i++ ) {