Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » AdapterFactoryLabelProvider, GMF and memory leak
AdapterFactoryLabelProvider, GMF and memory leak [message #418992] Wed, 07 May 2008 13:38 Go to next message
Mariot Chauvin is currently offline Mariot ChauvinFriend
Messages: 174
Registered: July 2009
Senior Member
Hi,

While trying to find memory leak in my GMF based modeler, I found some code generated by GMF, which seems to me leaked :

/**
* @generated
*/
public class LabelProviderWrapper extends DecoratingLabelProvider {

/**
* @generated
*/
public LabelProviderWrapper() {
super(new AdapterFactoryLabelProvider(MyPlugin.getInstance().getItemPr ovidersAdapterFactory()), null);
}

....

This code is called each time I open my modeler editor.
As my adapterFactory is an instance of IChangeNotifier, the label provider is added as listener to my adapter factory and not removed when editor
closed :(.

If I did not miss something, I think it would be nice to inform in AdapterFactoryLabelProvider constructor javadoc that if the adapter factory given
as parameter is an instance of IChangeNotifier, the label provider will be added as listener to the adapter factory.

Regards,

Mariot
Re: AdapterFactoryLabelProvider, GMF and memory leak [message #418997 is a reply to message #418992] Wed, 07 May 2008 14:47 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Mariot,

Open a bugzilla and I'll add some Javadoc to point out that "dispose"
should be called.


Mariot Chauvin wrote:
> Hi,
>
> While trying to find memory leak in my GMF based modeler, I found some
> code generated by GMF, which seems to me leaked :
>
> /**
> * @generated
> */
> public class LabelProviderWrapper extends DecoratingLabelProvider {
>
> /**
> * @generated
> */
> public LabelProviderWrapper() {
> super(new
> AdapterFactoryLabelProvider(MyPlugin.getInstance().getItemPr ovidersAdapterFactory()),
> null);
> }
>
> ....
>
> This code is called each time I open my modeler editor.
> As my adapterFactory is an instance of IChangeNotifier, the label
> provider is added as listener to my adapter factory and not removed
> when editor closed :(.
>
> If I did not miss something, I think it would be nice to inform in
> AdapterFactoryLabelProvider constructor javadoc that if the adapter
> factory given as parameter is an instance of IChangeNotifier, the
> label provider will be added as listener to the adapter factory.
>
> Regards,
>
> Mariot


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Synchronization problems between model resources
Next Topic:EditingDomainActionBarContributor
Goto Forum:
  


Current Time: Sat Apr 20 00:30:33 GMT 2024

Powered by FUDForum. Page generated in 0.03432 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top