flamingo
  1. flamingo
  2. FLAMINGO-81

SvgBatikIcon allocates thread pool but never shuts it down

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Blocker Blocker
    • Resolution: Unresolved
    • Affects Version/s: 5.0
    • Fix Version/s: milestone 1
    • Component/s: common components
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      81

      Description

      SvgBatikIcon allocates a static thread pool:

      private static ExecutorService loadService = Executors.newFixedThreadPool(5);

      but never calls shutdown() on this. This means that if you ever create an SVG
      icon, you hang the shut down sequence (forcing a System.exit(0) call) since the
      VM won't shut down when the event thread shuts down after the last window is
      disposed.

      Workaround is to not use SVG icons...

        Activity

        Hide
        laseray added a comment - - edited

        In class SvgBatikIcon, method renderGVTTree(), inside run() I added loadService.shutdown() and it "seems" to do the trick. I only used it to display a single sized icon so far.

        ...
        if (bufferedImage != null) {
        synchronized (SvgBatikIcon.this)

        { cachedImages.put(key, bufferedImage); }

        ev = new GVTTreeRendererEvent(this, bufferedImage);
        fireEvent(completedDispatcher, ev);
        loadService.shutdown();
        }
        } catch (InterruptedBridgeException e)
        ...

        Show
        laseray added a comment - - edited In class SvgBatikIcon, method renderGVTTree(), inside run() I added loadService.shutdown() and it "seems" to do the trick. I only used it to display a single sized icon so far. ... if (bufferedImage != null) { synchronized (SvgBatikIcon.this) { cachedImages.put(key, bufferedImage); } ev = new GVTTreeRendererEvent(this, bufferedImage); fireEvent(completedDispatcher, ev); loadService.shutdown(); } } catch (InterruptedBridgeException e) ...

          People

          • Assignee:
            kirillcool
            Reporter:
            flynnk
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: