Community
Participate
Working Groups
Build Identifier: This issue is related to Bug 154145, but it's not the same. The current approach in PaletteEditPart to create images is via a static ImageCache. Images are created once and then never disposed. This is an issue in my case as the palette contents is more dynamic and can change at runtime. Since images are never disposed the application runs out of SWT resources at some point. I think a proper solution should use a ResourceManager that is passed down into the edit part using a viewer property. If there is no ResourceManager then the code can fall back to using ImageCache. This way the host application can better control the lifecycle of images. It can choose to pre-allocate images to match current behavior or create them on demand. The ResourceManager can also be shared between multiple palettes to allow for image reuse. I created a patch for what I have in mind. Note that when the descriptor changes, a new image is created first and old descriptor is destroyed after. This way if the descriptor is the same (equals) then the image is reused. Reproducible: Always
Created attachment 215623 [details] Added support for ResourceManager to PaletteEditPart