From: Brian G. <br...@qu...> - 2003-07-15 18:49:10
|
>Perhaps we can come up with a better way of handling this, like a >ContextUnbindListener so that tools can register themselves if they need to >be notified when the context is finished with them? I'm open to that. Right now, the context keeps a list of tools its initialized, and then relies on clear() getting called to call the dtors of those tools. It increases the cost of creating and destroying the context, and undermines garbage collection as it keeps extra references around. Here's some alternatives: - have each method in the tool acquire and release the resources it needs within the call. That way, no cleanup is needed. - Use finalizers in tools that need cleanup. That's ugly, but its at least a last-ditch safety net. I think we need some solid use cases first, and then can come up with a strategy. Care to describe what your current tools do? -- Brian Goetz Quiotix Corporation br...@qu... Tel: 650-843-1300 Fax: 650-324-8032 http://www.quiotix.com |