Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » SWT Resources RAP
SWT Resources RAP [message #1007236] Tue, 05 February 2013 08:17 Go to next message
Tiburon T is currently offline Tiburon TFriend
Messages: 53
Registered: October 2011
Member
Hello,

I am uncertain on how to handle Resources like Image, Color and Font in RAP. As far as I know they have to be disposed by the creator in SWT, because native OS resources are used.[1]

Now I am wondering, if disposing of these resources is necessary in RAP, too. If they need to be disposed, I would also like to know if they are allocated seperately for each user session or only once for the whole application.

I took a look at org.eclipse.swt.graphics.Image in my RAP workspace and the destroy() method is actually empty, but the documentation of Resource still says: "Applications must dispose of all resources which they allocate."

Thanks,
Tiburon

[1]http://www.eclipse.org/articles/swt-design-2/swt-design-2.html
Re: SWT Resources RAP [message #1007251 is a reply to message #1007236] Tue, 05 February 2013 09:20 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1291
Registered: July 2009
Senior Member

Hi Tiburon,

in SWT resources must be disposed of because they allocate OS resources.
You're right that in RAP, this is not really necessary, but it also
doesn't hurt. We inherited the JavaDoc from SWT and didn't change this
part, because with single sourcing in mind, it's still a good practice
to do so.

Does that answer your question?

Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: SWT Resources RAP [message #1007270 is a reply to message #1007251] Tue, 05 February 2013 10:23 Go to previous message
Tiburon T is currently offline Tiburon TFriend
Messages: 53
Registered: October 2011
Member
Hi Ralf,

thanks for your answer - everythings clear now.

Greetings
Tiburon
Previous Topic:[ANN] RAP 2.0 RC2 published
Next Topic:keyPressed event lacks propper stateMask on first event?
Goto Forum:
  


Current Time: Wed Nov 26 01:00:34 GMT 2014

Powered by FUDForum. Page generated in 0.01602 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software