Merge remote-tracking branch 'origin/patch'

This commit is contained in:
Ryan Kurtz
2026-01-08 12:40:23 -05:00
@@ -38,7 +38,7 @@ public class PyGhidraTaskMonitor implements TaskMonitor {
private boolean isIndeterminate; private boolean isIndeterminate;
private volatile boolean isCancelled; private volatile boolean isCancelled;
private Timer timer = new Timer(); private Timer timer;
private WeakSet<CancelledListener> listeners = private WeakSet<CancelledListener> listeners =
WeakDataStructureFactory.createCopyOnReadWeakSet(); WeakDataStructureFactory.createCopyOnReadWeakSet();
private TriConsumer<String, Long, Long> changeCallback; private TriConsumer<String, Long, Long> changeCallback;
@@ -55,6 +55,7 @@ public class PyGhidraTaskMonitor implements TaskMonitor {
TriConsumer<String, Long, Long> changeCallback) { TriConsumer<String, Long, Long> changeCallback) {
isCancelled = false; isCancelled = false;
if (timeoutSecs != null) { if (timeoutSecs != null) {
timer = new Timer(true);
timer.schedule(new PyGhidraTimeOutTask(), timeoutSecs * 1000); timer.schedule(new PyGhidraTimeOutTask(), timeoutSecs * 1000);
} }
this.changeCallback = changeCallback; this.changeCallback = changeCallback;
@@ -143,7 +144,9 @@ public class PyGhidraTaskMonitor implements TaskMonitor {
@Override @Override
public void cancel() { public void cancel() {
if (timer != null) {
timer.cancel(); // Terminate the timer thread timer.cancel(); // Terminate the timer thread
}
isCancelled = true; isCancelled = true;
} }