Menu

#20 Image objects in many LabelProviders are never disposed

none
closed-fixed
None (23)
5
2010-10-01
2009-04-02
jfirechief
No

DO NOT EDIT OR ANSWER THIS ISSUE. SEE THE ORIGINAL ISSUE INSTEAD:
https://www.jfire.org/modules/bugs/view.php?id=1059
ORIGINAL REPORTER: marco

Some LabelProvider implementations used in some PropertyDescriptors create Image objects on the fly and never dispose them.

Discussion

  • jfirechief

    jfirechief - 2009-04-02
    • labels: --> None
    • milestone: --> none
    • assigned_to: nobody --> nlmarco
    • status: open --> open-fixed
     
  • jfirechief

    jfirechief - 2009-04-02

    ORIGINAL COMMENT BY marco, VIEW IT HERE:
    https://www.jfire.org/modules/bugs/view.php?id=1059

    I added some pooling in the LabelProvider implementations and implemented the ILabelProvider.dispose() method correctly to dispose all Image instances in the pool.

    Unfortunately, the PropertyDescriptor framework of Eclipse seems to lack a clean resource-life-cycle. Therefore, Image objects created by the getImage() method are never disposed - even if they are pooled.

    Hence, I introduced the new interface IXPropertyDescriptor (I extracted it from the existing XPropertyDescriptor). It contains onActivate() and onDeactivate() methods for a clean life-cycle. The LabelProviders are now not created in the constructors of the IXPropertyDescriptor implementations but they are created in the onActivate() methods and disposed & nulled in the onDeactivate() methods.

    The new IXPropertyDescriptor is understood by the properties-view of the Editor2D. AFAIK, the property descriptors are not yet used anywhere else.

     
  • jfirechief

    jfirechief - 2010-10-01
    • status: open-fixed --> closed-fixed
     
  • jfirechief

    jfirechief - 2010-10-01

    ORIGINAL COMMENT BY marco, VIEW IT HERE:
    https://www.jfire.org/modules/bugs/view.php?id=1059

    I added some pooling in the LabelProvider implementations and implemented the ILabelProvider.dispose() method correctly to dispose all Image instances in the pool.

    Unfortunately, the PropertyDescriptor framework of Eclipse seems to lack a clean resource-life-cycle. Therefore, Image objects created by the getImage() method are never disposed - even if they are pooled.

    Hence, I introduced the new interface IXPropertyDescriptor (I extracted it from the existing XPropertyDescriptor). It contains onActivate() and onDeactivate() methods for a clean life-cycle. The LabelProviders are now not created in the constructors of the IXPropertyDescriptor implementations but they are created in the onActivate() methods and disposed & nulled in the onDeactivate() methods.

    The new IXPropertyDescriptor is understood by the properties-view of the Editor2D. AFAIK, the property descriptors are not yet used anywhere else.

     

Log in to post a comment.

MongoDB Logo MongoDB