Details

    • Type: Sub-task
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 3.3.0.M4
    • Fix Version/s: 3.3.0.M5
    • Component/s: common
    • Labels:
      None

      Description

      small note -> org.jboss.tools.common.model.icons.impl.XStudioIcons:

          public Image getImage(XModelObject obj) {                       <---------------- this function create Image and does not dispose it - so real name should sounds like createImage(...)
              String s = obj.getAttributeValue("image"); //$NON-NLS-1$
              byte[] b = decode(s);
              if(b != null) {
              	try { 
              		ByteArrayInputStream is = new ByteArrayInputStream(b);
              		ImageData id = new ImageData(is);
              		Image i = new Image(null, id);                        <---- create image here    
              		return i;
              	} catch (SWTException e) {
              		ModelPlugin.getPluginLog().logError(e);
              	} catch (SWTError e) {
              		ModelPlugin.getPluginLog().logError(e);
              	}
              }
         		return obj.getModelEntity().getMetaModel().getIconList().getImage("default.unknown"); //$NON-NLS-1$
          }
      
      

      org.jboss.tools.common.model.icons.impl.XModelObjectIcon

      private static Hashtable<String,Image> cacheEclipse = new Hashtable<String,Image>();
      

      all images which XStudioIcons creates --> in cacheEclipse.
      but what is happens if you reload org.jboss.tools.common.model plugin? I do not sure, but look like you'll get resource leak here.
      may be a better choise is to use AbstractUIPlugin.getImageRegistry(), i.e. ModelPlugin.getDefault().getImageRegistry()

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                scabanovich Viacheslav Kabanovich
                Reporter:
                vyemialyanchyk Vitali Yemialyanchyk
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: