[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: disposing objects - again

Thank you all for the reponse, i know about Font f = new Font(..) and then assigning it to g.setFont(f); i was just curious if there was a way to still dispose of the Font object or if this was something that is not recommended to be done. but Mr. Hudson recommnded gc.getFont().dispose(); seems like that might work.

Thank you.

On Tue, 15 Jul 2003 14:39:36 -0400, Richard L. Kulp <richkulp@xxxxxxxxxxxxxxxxx> wrote:

You did create it, so you need to dispose it. You can't create it within the statement because you can't find it. You need to create it assigned to a variable and then at the appropriate time using that variable dispose it.

ie:

Font f = new Font(...)
gc.setFont(f);

and at appropriate point:
f.dispose();


Rich





-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/