You open a color chooser in it, it gets added to a list to close should the parent window close
You close the chooser
Now the chooser is still in the list of closables, eg being kept alive by jvm.
This is potentially huge. But removing the sub window when its closing from the list can cause a concurrent modification exception, since it also gets triggered when the parent window closes, eg when we are looping over the list the sub window is now trying to remove itself from.
We should unify the listeners used for this and possibly write a manager for it, that handles these cases properly.
Scenario 1:
Now the chooser is still in the list of closables, eg being kept alive by jvm.
This is potentially huge. But removing the sub window when its closing from the list can cause a concurrent modification exception, since it also gets triggered when the parent window closes, eg when we are looping over the list the sub window is now trying to remove itself from.
We should unify the listeners used for this and possibly write a manager for it, that handles these cases properly.