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

Bug 460432

Summary: Dispose graphical listeners sooner during the close of an editor
Product: [Modeling] Sirius Reporter: Laurent Redor <laurent.redor>
Component: DiagramAssignee: Laurent Redor <laurent.redor>
Status: CLOSED FIXED QA Contact: Belqassim Djafer <belqassim.djafer>
Severity: normal    
Priority: P3 CC: maxime.porhel, pierre-charles.david
Version: 2.0.0Keywords: triaged
Target Milestone: 2.0.5   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/42275
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=ed7aa3572746fd6c1c7238415e10dc0ccd3ee204
https://git.eclipse.org/r/42396
https://git.eclipse.org/r/42417
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=205903dd5d791e5d134faded6c762ad06b32614a
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=9393d3b43397b3946b81ae3c75d30e48afeaf82d
https://git.eclipse.org/r/42623
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=341da504dd31742f48059e974eeb6bb270f03ffd
Whiteboard:
Bug Depends on:    
Bug Blocks: 460816    

Description Laurent Redor CLA 2015-02-20 06:34:25 EST
Currently, the dispose of "graphical listeners"* are made in the DDiagramEditorImpl.dispose(). But this method is finally called in asyncExec by org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.close(boolean). This can be problematic because these listeners can be called with inconsistent state during the close.

It is possible to dispose these graphical listeners directly in DDiagramEditorImpl.dispose(), before the call to super.close(boolean), to avoid this kind of problem.

"Graphical listeners": All the listeners that update the diagram accordingly to notifications
Comment 1 Eclipse Genie CLA 2015-02-20 06:39:42 EST
New Gerrit change created: https://git.eclipse.org/r/42275
Comment 3 Maxime Porhel CLA 2015-02-20 08:50:15 EST
Laurent, do you have a reproduction case showing the issue ? 
To validate the correction.
Comment 4 Laurent Redor CLA 2015-02-23 03:52:09 EST
Maxime: There is no real reproduction case. The problem is only reproductible with Capella. I will add a junit test to reveal the problem.
Comment 5 Eclipse Genie CLA 2015-02-23 03:57:42 EST
New Gerrit change created: https://git.eclipse.org/r/42396
Comment 6 Laurent Redor CLA 2015-02-23 07:55:13 EST
A regression has been detected by automatic tests: PinnedElementsOnTreeDiagramTest.testPinnedAttributeIsPersistent() is in timeout

The dispose of the tabbar must be called in UI thread.
Comment 7 Eclipse Genie CLA 2015-02-23 09:22:43 EST
New Gerrit change created: https://git.eclipse.org/r/42417
Comment 11 Eclipse Genie CLA 2015-02-25 06:05:31 EST
New Gerrit change created: https://git.eclipse.org/r/42623
Comment 13 Laurent Redor CLA 2015-02-25 10:31:14 EST
Resolved with the last commit.
Comment 14 Laurent Redor CLA 2015-03-30 05:45:34 EDT
Verified on Sirius 2.0.5 [1]

[1] http://download.eclipse.org/sirius/updates/stable/2.0.5-S20150321-000123
Comment 15 Laurent Redor CLA 2015-03-31 10:20:55 EDT
Available in Sirius 2.0.5.