Hi Clemens,
Hi Pavel,

    In common case you shouldn't remove listeners of course. But in
    your case you must remove listeners because of editor is shared
    between all JTextComponents (see javadoc of the
    JTextComponent#getActions method and BasicTextUI#getEditorKit
    implementation). So you added listeners not to a JTextComponent
    instance, but to the shared editor.


Thanks a lot for clarification, I wasn't sure this behaviour is intended :/ Seems I have to adopt the jfc-demo Notepad to not leak memory when running on caciocavallo-web ;)
I took a look at the Notepad demo and didn't find any problems. It adds listeners only when the demo starts and there is no need to remove listeners, because the demo closes via System.exit(0). Could you please explain how did you get memory leak in the demo?

Regards, Pavel

Reply via email to