Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

DefaultTemplateProposalProvider.getImage() leaks images #1622

Closed
iloveeclipse opened this issue Jan 16, 2021 · 6 comments
Closed

DefaultTemplateProposalProvider.getImage() leaks images #1622

iloveeclipse opened this issue Jan 16, 2021 · 6 comments
Assignees
Milestone

Comments

@iloveeclipse
Copy link

iloveeclipse commented Jan 16, 2021

In our tests started with 4.19 / extra VM flag:
-Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true
I see few errors reported with following stack:

	at org.eclipse.swt.graphics.Resource.<init>(Resource.java:111)
	at org.eclipse.swt.graphics.Resource.<init>(Resource.java:116)
	at org.eclipse.swt.graphics.Image.<init>(Image.java:653)
	at org.eclipse.jface.resource.URLImageDescriptor.createImage(URLImageDescriptor.java:274)
	at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:287)
	at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:265)
	at org.eclipse.xtext.ui.editor.templates.DefaultTemplateProposalProvider.getImage(DefaultTemplateProposalProvider.java:87)

There is no attempt of either caching or re-using or disposing images created inside DefaultTemplateProposalProvider.getImage.

@cdietrich
Copy link
Member

besides fixing the actual problem we also should run our eclipse and xtend tests with "latest" and -Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=stacks and then check the log

@ArneDeutsch ArneDeutsch self-assigned this Feb 5, 2021
ArneDeutsch added a commit that referenced this issue Feb 5, 2021
Signed-off-by: Arne Deutsch <Arne.Deutsch@itemis.de>
@ArneDeutsch ArneDeutsch added this to the Release_2.25 milestone Feb 5, 2021
@cdietrich
Copy link
Member

the parameter is actually

-Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true

@cdietrich
Copy link
Member

@iloveeclipse do i need a special application to reproduce this. with the default i cant. (i can track other non disposes, but not this one)

@iloveeclipse
Copy link
Author

@cdietrich : I've answered on our internal tracker. I have no clue about application itself and why it is doing whatever it does to call this API, I'm just "the messenger".

@cdietrich
Copy link
Member

cdietrich commented Feb 8, 2021

this seems also to be a singleton problem. if you remove it from custom subclass, open and close editor, boom

ArneDeutsch added a commit that referenced this issue Feb 12, 2021
…lt-template-proposal-provider

[#1622] Use plugin image registry to avoid leak.
@cdietrich
Copy link
Member

Fixed in 2.25

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants