Hi Lukasz,
Lukasz Matuszczak wrote:
I am still fighting with "dispose()" problems, and I discovered something, which I consider a bug (it appears in 1.5.1 release and in a latest version from CVS head).
The problem is when I call method "suspendProcessing()" followed by "dispose()" on JSVGCanvas object,
the JSVGCanvas won't be collected by garbage collector. This is somehow connected with UpdateManager ant its RunnableQueue, I think.
This is tied to the following bug: http://issues.apache.org/bugzilla/show_bug.cgi?id=30189
I think I have a solution to this bug. This makes it clear why suspend/dispose isn't shutting down the UpdateManager Thread properly, but I am unsure why this would prevent GC (this is also troubling). My fix for the suspend/resume race condition does allow the Canvas to go to GC.
One question on this, what events should be sent? when suspend and resume are called in close proximity (i.e. before the runnable thread actually suspends). Right now no thread events get sent (just like if you call resume when the thread is already running).
You may ask why i call dispose() after suspendProcessing() (why not only dispose()). The answer is that I have my own queue of events in my application, and sometimes I get a request to deactivate the SVG screen (suspendProcessing), and soon after that to close it (close). I handle these events one after another (of course AWT in event dispatch thread).
Sure, this is an expected usecase.
Thanks for the good test case.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]