Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BufferedImages not garbage collected -- any suggestions?




Hi Scott.

In my previous message, I mentioned that the documentation for the library I am using stated that it would return a BufferedImage (even though the return type was simply, Image). I used the debugger to attempt to confirm that the documentation was correct, and instead, I found that the actual type of the returned Image was "apple.awt.OSXImage".

So to answer your question, no, "createCompatibleImage()" was likely not used even though the documentation mentioned it specifically. I suspect that this library evolved faster than its docs did, and that's where this particular bit of confusion stemmed from.

Regards,
-Mike Ellis

On Mar 31, 2006, at 3:03 PM, email@hidden wrote:

On 30-Mar-06, at 2:00 PM, Greg Guerin wrote:

Michael Ellis wrote:

Apparently, the library documentation has not been updated,
because when I
check the type of the returned objects in the debugger, I find
that I am
receiving "apple.awt.OSXImage" instances, not the BufferedImage
instances I
expected.

That is truly remarkable! I was going to suggest that
apple.awt.OSXImage
might subclass BufferedImage, but when I check the 1.4.2 jars, neither
apple.awt.OSXImage nor its superclass sun.awt.image.Image subclasses
BufferedImage. Yet somehow, this isn't considered a type-safety
error.

Michael,

Are you really using the createCompatibleImage() API from the
GraphicsConfiguration object?
You mentioned java.awt.Toolkit.createImage() which is only documented
as returning an Image, not a BufferedImage.  Same with
Component.createImage().

Scott

========================= Michael F. Ellis President Ellis Softworks Inc. ---------- Phone: (941) 713-0361 Email: email@hidden Web: http://www.ellissoftworks.com


_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.