mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
dispose alarm explicitly to avoid assertions
This commit is contained in:
+21
-15
@@ -106,25 +106,31 @@ public class DebuggerManagerThreadImpl extends InvokeAndWaitThread<DebuggerComma
|
||||
invoke(command);
|
||||
|
||||
if (currentCommand != null) {
|
||||
assert !myDisposed;
|
||||
final Alarm alarm = new Alarm(Alarm.ThreadToUse.SHARED_THREAD, this);
|
||||
final Alarm alarm = new Alarm(Alarm.ThreadToUse.SHARED_THREAD);
|
||||
alarm.addRequest(new Runnable() {
|
||||
public void run() {
|
||||
if (currentCommand == myEvents.getCurrentEvent()) {
|
||||
// if current command is still in progress, cancel it
|
||||
getCurrentRequest().interrupt();
|
||||
try {
|
||||
getCurrentRequest().join();
|
||||
}
|
||||
catch (InterruptedException ignored) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
finally {
|
||||
startNewWorkerThread();
|
||||
try {
|
||||
if (currentCommand == myEvents.getCurrentEvent()) {
|
||||
// if current command is still in progress, cancel it
|
||||
getCurrentRequest().interrupt();
|
||||
try {
|
||||
getCurrentRequest().join();
|
||||
}
|
||||
catch (InterruptedException ignored) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
finally {
|
||||
if (!myDisposed) {
|
||||
startNewWorkerThread();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally {
|
||||
Disposer.dispose(alarm);
|
||||
}
|
||||
}
|
||||
}, terminateTimeout);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user