Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325765 - Use of deprecated method that is responsible of Memory Leak in ValidationAction.runinNonUIValidation
Summary: Use of deprecated method that is responsible of Memory Leak in ValidationActi...
Status: NEW
Alias: None
Product: GMF-Tooling
Classification: Modeling
Component: Core (show other bugs)
Version: 2.3.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.0M5   Edit
Assignee: Svyatoslav Kovalsky CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-20 10:47 EDT by Aurelien Pupier CLA
Modified: 2012-01-18 19:28 EST (History)
3 users (show)

See Also:


Attachments
Patch using the new API (951 bytes, text/plain)
2010-09-20 10:50 EDT, Aurelien Pupier CLA
no flags Details
A working patched (986 bytes, text/plain)
2010-09-21 04:52 EDT, Aurelien Pupier CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aurelien Pupier CLA 2010-09-20 10:47:23 EDT
Build Identifier: 20100617-1415

The template use the deprecate method.

Reproducible: Always
Comment 1 Aurelien Pupier CLA 2010-09-20 10:50:05 EDT
Created attachment 179250 [details]
Patch using the new API

Use the new API to avoid Memory leak.
The patch is applied to the file 
org.eclipse.gmf.codegen/template/xpt/editor/ValidateAction.xpt
Comment 2 Aurelien Pupier CLA 2010-09-21 04:52:31 EDT
Created attachment 179294 [details]
A working patched
Comment 3 Ralph Gerbig CLA 2011-11-23 07:04:24 EST
I looked at your patch and wonder why you are not using this call:

DiagramEditPart diagramEditPart = OffscreenEditPartFactory
				.getInstance().createDiagramEditPart(view.getDiagram(), PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());

but do instead create a new shell.
Comment 4 Aurelien Pupier CLA 2011-11-23 07:13:11 EST
Because the PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell() might not be available.
And also, I'm not sure, it was some times ago but there was some memory issues with objects kept in Shell memory and so with a new Shell we can dispose it.