Menu

#29 Images are leaked

0.9.8
closed
fixed (10)
5
2016-04-20
2014-11-26
No

The image for each node is acquired and then leaked. Using the outline view with the Json editor will result in SWT running out of handles eventually.

The JsonTreeNode's getImage method is where the problem occurs:

https://sourceforge.net/p/eclipsejsonedit/code/HEAD/tree/Json/trunk/jsonedit-outline/src/main/java/com/boothen/jsonedit/outline/node/JsonTreeNode.java

though the real problem is that the map of types-to-image should really be using an org.eclipse.jface.resource.ImageRegistry and put the ImageDescriptor, followed by getting the image from that.

static {
ImageRegistry registry = new ImageRegistry();
registry.put(JsonArrayNode.class.getName(), ImageDescriptor.createFromURL(JsonNode.getResource("/icons/JsonArray.gif")))
}

public Image getImage() {
return registry.get(jsonNode.getClass().getName());
}

Discussion

  • Boothen Technology

    • labels: --> fixed
    • Group: 0.9.7 --> 0.9.8
     
  • Boothen Technology

    Will be fixed in 0.9.8

     
  • msteiger

    msteiger - 2016-04-20
    • status: open --> closed
     

Log in to post a comment.