mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
IDEA-155007 check shouldKillProcessSoftly
This commit is contained in:
@@ -243,11 +243,12 @@ public class DebuggerManagerImpl extends DebuggerManagerEx implements Persistent
|
||||
processHandler.addProcessListener(new ProcessAdapter() {
|
||||
@Override
|
||||
public void processWillTerminate(ProcessEvent event, boolean willBeDestroyed) {
|
||||
final DebugProcessImpl debugProcess = getDebugProcess(event.getProcessHandler());
|
||||
ProcessHandler processHandler = event.getProcessHandler();
|
||||
final DebugProcessImpl debugProcess = getDebugProcess(processHandler);
|
||||
if (debugProcess != null) {
|
||||
// if current thread is a "debugger manager thread", stop will execute synchronously
|
||||
// it is KillableColoredProcessHandler responsibility to terminate VM
|
||||
debugProcess.stop(willBeDestroyed && !(event.getProcessHandler() instanceof KillableColoredProcessHandler));
|
||||
debugProcess.stop(willBeDestroyed && !(processHandler instanceof KillableColoredProcessHandler && ((KillableColoredProcessHandler)processHandler).shouldKillProcessSoftly()));
|
||||
|
||||
// wait at most 10 seconds: the problem is that debugProcess.stop() can hang if there are troubles in the debuggee
|
||||
// if processWillTerminate() is called from AWT thread debugProcess.waitFor() will block it and the whole app will hang
|
||||
|
||||
Reference in New Issue
Block a user