Open garfieldnate opened 3 months ago
This is caused by our firing some agent logic on separate threads while in the actual SML before-agent-destroyed handler. Once the logic runs, the agent is already gone, and this line takes note of that and calls fireAgentGone
instead of fireAgentLosingFocus
. All of the event deregistration happens in fireAgentLosingFocus
, including system events, which are not dependent on the agent and will continue to be fired after the agent is destroyed.
There are some obvious looking fixes (run the logic in the current thread instead of separate threads), but there are some very threatening-looking comments about potential deadlocks and such, so I'd rather avoid that. I think the proper fix is to separate the kernel-dependent and the agent-dependent event registration/de-registration.
1) open debugger 2) Agents->Create Agent - New Window 3) In new agent window, Agents -> Destroy Agent 4) On remaining agent window, "step"
Prints these errors:
Note that this issue does not occur if you close the window without destroying the agent.
I suppose that the print listener for the window is not being deregistered, and thus it fires and tries to print in a non-existent window.