Skip to content

Ghidra is a software reverse engineering (SRE) framework

Merge remote-tracking branch 'origin/patch'

dragonmacherfa18866fa894
diff --cc Ghidra/Framework/Docking/src/main/java/ghidra/util/task/TaskDialog.java
index 4803a3be21,1c1fb98e11..56d8b9a148
--- a/Ghidra/Framework/Docking/src/main/java/ghidra/util/task/TaskDialog.java
+++ b/Ghidra/Framework/Docking/src/main/java/ghidra/util/task/TaskDialog.java
@@@ -269,9 -285,9 +285,10 @@@ public class TaskDialog extends DialogC
}
protected void doShow() {
+
Swing.runIfSwingOrRunLater(() -> {
if (!isCompleted()) {
+ shown.set(true);
DockingWindowManager.showDialog(centerOnComponent, TaskDialog.this);
}
});
diff --cc Ghidra/Framework/Generic/src/main/java/ghidra/util/timer/GTimer.java
index 940a896435,cea4c5b087..c8f932379b
--- a/Ghidra/Framework/Generic/src/main/java/ghidra/util/timer/GTimer.java
+++ b/Ghidra/Framework/Generic/src/main/java/ghidra/util/timer/GTimer.java
@@@ -20,22 -20,13 +20,22 @@@ import java.util.TimerTask
import ghidra.util.Msg;
+/**
+ * A class to schedule {@link Runnable}s to run after some delay, optionally repeating. This class
+ * uses a {@link Timer} internally to schedule work. Clients of this class are given a monitor
+ * that allows them to check on the state of the runnable, as well as to cancel the runnable.
+ */
public class GTimer {
private static Timer timer;
- private static GTimerMonitor DO_NOTHING_MONITOR = new DoNothingMonitor();
+ private static GTimerMonitor DO_NOTHING_MONITOR = GTimerMonitor.DUMMY;
/**
- * Schedules a runnable for execution after the specified delay.
- * @param delay the time (in milliseconds) to wait before executing the runnable.
+ * Schedules a runnable for execution after the specified delay. A delay value less than 0
+ * will cause this timer to schedule nothing. This allows clients to use this timer class
+ * with no added logic for managing timer enablement.
+ *
+ * @param delay the time (in milliseconds) to wait before executing the runnable. A negative
+ * value signals not to run the timer--the callback will not be executed
* @param callback the runnable to be executed.
* @return a GTimerMonitor which allows the caller to cancel the timer and check its status.
*/