Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8106624

Image backgroundLoading hangs after accumulated errors or cancels

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • fx1.3
    • fx1.0
    • javafx
    • windows, vista - not related to the defect

      This is an issue with the JavaFX production 1.1 release (didn't see a version choice for this).

      When backgroundLoading is set to true, the Image will hang during load and stay at 0 percent progress. This happens under the following conditions:
      * More than 4 images loaded with errors previously
      * More than 4 images cancelled by calling the cancel() method previously

      Every subsequent image load after some combination of the above conditions will hang when loaded in the background. The only recourse at this point is to restart the application.

      I traced this back to an issue in the Image class where the number of running tasks is not properly decremented when there are errors or the cancel() method is called. Also, the next pending task is not kicked off in these cases either.

      I put together an ImageFix class in the JFXtras open-source project that works around this issue by decrementing $runningTasks and firing off the next $pendingTask. That code can be used with the 1.1 release as an end user workaround, and may be helpful in diagnosing the problem for the next JavaFX release:
      http://code.google.com/p/jfxtras/source/browse/trunk/src/org/jfxtras/scene/image/ImageFix.fx
      http://code.google.com/p/jfxtras/source/browse/trunk/src/org/jfxtras/scene/image/ImageFixHelper.java

            tdv Dmitri Trembovetski (Inactive)
            schin Stephen Chin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: