Skip to main content

CSH.setHelpIDString

1 reply [Last post]
mjsong
Offline
Joined: 2003-06-13

To enable the context sensitive help on a dialog, I use

CSH.enableHelpKey(getRootPane(), "dialog", null);

in the dialog's constructor.

I am wondering if this method can cause memory leak. Does the CSH caches a reference to the root pane even after the dialog is disposed?

I do not have a memory debugger to try it. Can some one confirm my concern?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Roger Brinkley

javahelp1@JAVADESKTOP.ORG wrote:

> To enable the context sensitive help on a dialog, I use
>
> CSH.setHelpIDString(getRootPane(), "dialog", null);

The method you described above doesn't exist with three parameters. Only 2.

> in the dialog's constructor.
>
> I am wondering if this method can cause memory leak. Does the CSH
> caches a reference to the root pane even after the dialog is
> disposed?

There shouldn't be any memory retention unless parameter you pass in is
not a JComponent. In that case it would possibly retain a reference to
the component in a WeakHashMap using the component as the key. The
WeakHashMap should remove the entry when the component id destroyed.
However, if you want to be sure the reference is removed make the same
call with a null ID and the component is removed from the hashtable.

Binky

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.