[gui] [PATCH] Fix MediaTracker.addImage()
David Jee
djee@redhat.com
Sat Jun 12 00:11:00 GMT 2004
Hello,
I committed the following patch to the java-gui-branch. It fixes
MediaTracker.addImage(), so that it calls MediaTracker.imageUpdate() on
the newly added MediaEntry. This ensures that the MediaEntry has the
latest image status, and it also ensures that any thread that has been
waiting for the image to load is notified if necessary.
This latter scenario seems unlikely, since it doesn't make sense to call
MediaTracker.waitForID() or MediaTracker.waitForAll() until you've
registered the image first with addImage(). However, there is a case
where waitForID() or waitForAll() is called after addImage(), but the
image has already finished loading before addImage() was even called.
In this case, unless imageUpdate() is called, the waiting threads will
never be notified that the image is complete, resulting in an infinite
wait.
-David Jee
2004-06-11 David Jee <djee@redhat.com>
* java/awt/MediaTracker.java
(addImage(Image,int)): Call imageUpdate() to udpate image status.
(addImage(Image,int,int,int)): Likewise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MediaTrackerAddImage.patch
Type: text/x-patch
Size: 949 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20040612/a0d1043e/attachment.bin>
More information about the Java-patches
mailing list