mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
call dispose() on session that failed to start
This commit is contained in:
@@ -1755,7 +1755,7 @@ public abstract class DebugProcessImpl implements DebugProcess {
|
||||
fail();
|
||||
if (myExecutionResult != null || !connectorIsReady.get()) {
|
||||
// propagate exception only in case we succeded to obtain execution result,
|
||||
// otherwise it the error is induced by the fact that there is nothing to debug, and there is no need to show
|
||||
// otherwise if the error is induced by the fact that there is nothing to debug, and there is no need to show
|
||||
// this problem to the user
|
||||
final RunProfile runProfile = state.getRunnerSettings().getRunProfile();
|
||||
if (runProfile != null) {
|
||||
|
||||
@@ -96,28 +96,29 @@ public class DebuggerPanelsManager implements ProjectComponent {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public
|
||||
RunContentDescriptor attachVirtualMachine(Executor executor,
|
||||
ProgramRunner runner,
|
||||
ExecutionEnvironment environment,
|
||||
RunProfileState state,
|
||||
RunContentDescriptor reuseContent,
|
||||
RemoteConnection remoteConnection,
|
||||
boolean pollConnection) throws ExecutionException {
|
||||
public RunContentDescriptor attachVirtualMachine(Executor executor,
|
||||
ProgramRunner runner,
|
||||
ExecutionEnvironment environment,
|
||||
RunProfileState state,
|
||||
RunContentDescriptor reuseContent,
|
||||
RemoteConnection remoteConnection,
|
||||
boolean pollConnection) throws ExecutionException {
|
||||
|
||||
final DebuggerSession debuggerSession =
|
||||
DebuggerManagerEx.getInstanceEx(myProject).attachVirtualMachine(executor, runner, (ModuleRunProfile) environment.getRunProfile(), state, remoteConnection, pollConnection);
|
||||
final DebuggerSession debuggerSession = DebuggerManagerEx.getInstanceEx(myProject).attachVirtualMachine(
|
||||
executor, runner, (ModuleRunProfile) environment.getRunProfile(), state, remoteConnection, pollConnection
|
||||
);
|
||||
if (debuggerSession == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final DebugProcessImpl debugProcess = debuggerSession.getProcess();
|
||||
if (debugProcess.isDetached() || debugProcess.isDetaching()) {
|
||||
debuggerSession.dispose();
|
||||
return null;
|
||||
}
|
||||
if (state instanceof RemoteState) {
|
||||
// optimization: that way BatchEvaluator will not try to lookup the class file in remote VM
|
||||
// which is an expensive oparation when executed first time
|
||||
// which is an expensive operation when executed first time
|
||||
debugProcess.putUserData(BatchEvaluator.REMOTE_SESSION_KEY, Boolean.TRUE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user