Forums Register Login

finalize() method

+Pie Number of slices to send: Send
Hello,
I have one doubt.
I am using VERY BIG Help file in JEditorPane ( to show online help) as follow.
URL url = ClassLoader.getSystemResource(fileName);
pane = new JEditorPane(url);
..................
.................
Now what should I make null, in finalize method, to free up non java resource ?
should it be url ?
or pane ?
i.e. should it be url = null;
or pane = null; in finalize method.
thanks in advance.
Devu
+Pie Number of slices to send: Send
If url is a class member, you should set both to null. If it's a local reference that goes away on the completion of its enclosing method, it would seem like setting pane to null is sufficient.
There's no significant cost in dong both when you're not sure, though.
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide
Goodbye moon men. Hello tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 784 times.
Similar Threads
finalize() use
Help Menu
Browser component for on-line help
finalize() doubt
JEditorPane problem
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:48:05.