Hi Matt,

On Sep 17, 2009, at 9:14 AM, webp...@tigris.org wrote:

>   I am using a router and the attach method (attach(<uri  
> pattern>,<class extends Resource>) for my application.  My question  
> is: when I'm finished with the resource (and I know I no longer need  
> it), what do I do to clean up?  Is it as simple as calling  
> router.detach?  or must I also delete the resource somehow so that  
> garbage collection can reclaim that memory?

Restlet creates a new instance of your resource class for each  
request.  It will go out of scope and be eligible for garbage  
collection after the request is complete.

If you are talking about having the resource class itself garbage  
collected, then I think that calling detach would be sufficient from  
the restlet perspective.  (Whether or not the class will actually be  
eligible for collection at that point depends on the environment in  
which you're running.)  I've never tried that myself, though.

Rhett

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2396121

Reply via email to