Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 325765

Summary: Use of deprecated method that is responsible of Memory Leak in ValidationAction.runinNonUIValidation
Product: [Modeling] GMF-Tooling Reporter: Aurelien Pupier <apupier>
Component: CoreAssignee: Svyatoslav Kovalsky <kovalsky>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: borlander, ralphgerbig, tikhomirov.artem
Version: 2.3.1   
Target Milestone: 3.0M5   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch using the new API
none
A working patched none

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.