Skip to content

Commit

Permalink
Deregister agent event handlers on window close
Browse files Browse the repository at this point in the history
Previously we only deregistered window update listeners when the corresponding
agent was destroyed; possibly it was never tested what would happen when a
single agent window was closed while leaving the agent alive.

Fixes #431.
  • Loading branch information
garfieldnate committed Feb 3, 2024
1 parent 460c98b commit 9e40f53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Java/Debugger/src/edu/umich/soar/debugger/MainFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,14 @@ private void thisWindowClosing()
m_bClosing = true;

// Need to explicitly release the focus which in turn will cause any
// listeners to unregister from this agent (is its still alive).
// listeners to unregister from this agent (if it's still alive).
// Otherwise our listeners will
// still be registered and will try to display output in windows that
// are disposed.
// This has the potential to deadlock (waiting to issue unregister calls
// while we're running) so we put
// it in a separate thread to avoid that.
Thread clearFocus = new Thread(() -> clearAgentFocus(false));
Thread clearFocus = new Thread(() -> clearAgentFocus(true));
clearFocus.start();

// DJP: Experiment
Expand Down

0 comments on commit 9e40f53

Please sign in to comment.