Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370754 - Closing a Sapphire diagram editor would clear up the all the diagram rendering context cache
Summary: Closing a Sapphire diagram editor would clear up the all the diagram renderin...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sapphire (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P1 blocker (vote)
Target Milestone: ---   Edit
Assignee: Shenxue Zhou CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-06 13:56 EST by Shenxue Zhou CLA
Modified: 2021-11-19 09:21 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shenxue Zhou CLA 2012-02-06 13:56:07 EST
If there are multiple Sapphire based diagram editors open, closing one would clear up the cache of all the diagram rendering context including the ones that are cached for other editors. This will result in NPE when executing context menus in other editors.
Comment 1 Konstantin Komissarchik CLA 2012-02-07 06:41:16 EST
When you fix this issue, please make sure to include additional information about the problem and the resolution in order for this to be verifiable.
Comment 2 Shenxue Zhou CLA 2012-02-07 13:37:01 EST
Here are the repro steps:

1. Open two Sapphire Diagram based editors
2. Closing one of them, and try to launch context menu in the other
3. You'll get an NPE.

The root cause was all Sapphire diagram based editors shared a static cache of all the DiagramRenderingContext. When an editor is closed, it also cleared up the cache thus causing other editors to lose their cached DiagramRenderingContext.

The fix is not to share the static DiagramRenderingContext cache. Instead, every editor instance hold its own DiagramRenderingContext cache. The cache will be disposed when the editor is closed.
Comment 3 Ling Hao CLA 2012-05-17 19:37:38 EDT
Verified via repro steps.