On 17/10/2013 11:39, Konstantin Kolinko wrote:
> 2013/10/17  <ma...@apache.org>:
>> Author: markt
>> Date: Thu Oct 17 10:32:21 2013
>> New Revision: 1533035
>>
>> URL: http://svn.apache.org/r1533035
>> Log:
>> Avoid hangs on shutdown
>>
>> Modified:
>>     
>> tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/classes/websocket/drawboard/Room.java
>>
> 
> I expect this to
> a) fail when running with a security manager
> b) cause a memory leak when examples app is reloaded, as you will get
> a new instance of ShutdownDetection class in webapp's classloader and
> new instance of shutdown hook.

I'm open to better suggestions. Another option I considered was just
removing the call to roomGraphics.dispose(); and letting GC take care of
things.

Alternatively, we could provide some form of global flag.

I think I prefer the global flag that indicates that a shutdown is in
process. I can think of several other places where such a flag would
have been useful and we can expose it through a custom servlet context
attribute such as "org.apache.tomcat.JVM_SHUTDOWN_IN_PROGRESS".

I'll start looking at the global flag option. Meanwhile, any suggestions
on how to improve the fix or an alternative fix welcome.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to