Fix crash when staging/unstaging too fast (or something like that).

This commit is contained in:
Martín Lucas Golini
2025-01-27 16:07:38 -03:00
parent 934a1f3302
commit 0005f9ff09
2 changed files with 13 additions and 8 deletions

View File

@@ -1,4 +1,3 @@
#include "debuggerplugin.hpp"
#include "../../notificationcenter.hpp"
#include "../../projectbuild.hpp"
#include "../../terminalmanager.hpp"
@@ -8,6 +7,7 @@
#include "bussocket.hpp"
#include "bussocketprocess.hpp"
#include "dap/debuggerclientdap.hpp"
#include "debuggerplugin.hpp"
#include "models/breakpointsmodel.hpp"
#include "models/processesmodel.hpp"
#include "models/variablesmodel.hpp"
@@ -1261,7 +1261,11 @@ void DebuggerPlugin::onRegisterDocument( TextDocument* doc ) {
}
} );
doc->setCommand( "debugger-start", [this] { runCurrentConfig(); } );
doc->setCommand( "debugger-start", [this] {
if ( mDebugger )
exitDebugger( true );
runCurrentConfig();
} );
doc->setCommand( "debugger-stop", [this] { exitDebugger( true ); } );