Bug 170493 - GMF Layout service getLayoutNode() does not dispose of off-screen shells
Summary: GMF Layout service getLayoutNode() does not dispose of off-screen shells
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: 1.0.2   Edit
Hardware: PC Windows 2000
: P3 normal
Target Milestone: ---   Edit
Assignee: Cherie Revells CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2007-01-15 11:31 EST by Kevin Cornell CLA
Modified: 2007-03-13 13:33 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Cornell CLA 2007-01-15 11:31:03 EST
I have written a pluglet that creates and manipulates many diagrams. Some of the manipulation require the pluglet to call LayoutService.getLayoutNode(Node node). This method creates off-screen edit parts for the diagram in order to obtain the actual dimensions for the given node. However, the method does not dispose of the edit parts or the underlying Windows shell and controls. As a result, the pluglet runs the first time but on the next run the entire Eclipse application hangs in SWT when it tries to create a new window for one of these off-screen edit parts.

I created a temporary fix that enabled me to run the pluglet multiple times without hanging. The fix is in LayoutService.getLayoutNode(Node node). Just before the return statement, the shell for the off-screen edit part is displosed as follows:

diagramEP.getViewer().getControl().getShell().dispose();

There should probably be a try catch block with a "finally" clause that disposes of the shell.
Comment 1 Kevin Cornell CLA 2007-01-16 15:06:05 EST
I believe this same issue occurs in LayoutService.layoutNodes(List, boolean, String).
Comment 2 Cherie Revells CLA 2007-03-13 13:33:30 EDT
- Deprecated the method createDiagramEditPart(Diagram diagram) in OffscreenEditPartFactory.  Users should call the method that takes a Shell as this method was not disposing the Shell that it created. 
- LayoutService and DiagramRenderUtil methods now temporary create a Shell where needed and then dispose it. 
- PrinterHelper, PrintPreviewHelper, and DiagramPrinter were also creating a diagram editpart without disposing the shell, so I modified the code to dispose the shell.
Comment 3 Eclipse Webmaster CLA 2010-07-19 12:30:27 EDT
[GMF Restructure] Bug 319140 : product GMF and component Runtime Diagram was the original product and component for this bug