mirror of
https://github.com/processing/processing4.git
synced 2026-02-09 16:49:21 +01:00
possibly cancel out-of-control Timer
This commit is contained in:
@@ -153,7 +153,6 @@ public abstract class Editor extends JFrame implements RunnerListener {
|
||||
Image backgroundGradient;
|
||||
|
||||
|
||||
// protected Editor(final Base base, String path, int[] location, final Mode mode) {
|
||||
protected Editor(final Base base, String path, final EditorState state,
|
||||
final Mode mode) throws EditorException {
|
||||
super("Processing", state.checkConfig());
|
||||
@@ -2026,6 +2025,7 @@ public abstract class Editor extends JFrame implements RunnerListener {
|
||||
return endUndoEvent != null;
|
||||
}
|
||||
|
||||
|
||||
void startTimerEvent() {
|
||||
endUndoEvent = new TimerTask() {
|
||||
public void run() {
|
||||
@@ -2037,6 +2037,7 @@ public abstract class Editor extends JFrame implements RunnerListener {
|
||||
timer.purge();
|
||||
}
|
||||
|
||||
|
||||
void endTextEditHistory() {
|
||||
if (endUndoEvent != null) {
|
||||
endUndoEvent.cancel();
|
||||
@@ -2045,6 +2046,13 @@ public abstract class Editor extends JFrame implements RunnerListener {
|
||||
stopCompoundEdit();
|
||||
}
|
||||
|
||||
|
||||
public void removeNotify() {
|
||||
timer.cancel();
|
||||
super.removeNotify();
|
||||
}
|
||||
|
||||
|
||||
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user