On 21/08/2011 01:19, Christopher Schultz wrote: > Pid, > > On 8/20/2011 6:06 PM, Pid wrote: >> On 19/08/2011 15:45, Christopher Schultz wrote: >>> Dan, >>> >>> On 8/18/2011 5:22 PM, Dan Armbrust wrote: >>>> Toolkit.getDefaultToolkit().createImage(new byte[]{}); >>> >>> Simply calling getDefaultToolkit will do the trick: you don't >>> have to waste time creating an image. >>> >>> I'll implement this in the JreLeakPreventionListener, but it will >>> be /disabled/ by default because it creates an extra thread. > > >> For this type of problem would it be useful to intercept the call >> to load the class & then trigger the protection 'on demand'? > > I'm not sure how one would intercept the call, though. I've never > looked into it, but I would guess that Toolkit.getDefaultToolkit can > be configured to return an object of a different class -- one that > would presumably temporarily set the CCL to the system ClassLoader.
Hmm. Modifying the loadClass(str) method might suffice, on the basis that a call to load Toolkit.class is likely to result in a Toolkit.getDefaultToolkit() - rather than trying to intercept the method call. p >> It might be a bit of a stretch to make it happen safely, >> admittedly. > > +1 > > -chris > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org >
signature.asc
Description: OpenPGP digital signature