<Swing Dev> Is the following code supposed to leak?

Clemens Eisserer linuxhippy at gmail.com
Mon Aug 22 23:17:02 UTC 2011


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 ;)

Thanks, Clemens
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20110823/bc2e2664/attachment.html>


More information about the swing-dev mailing list