Community
Participate
Working Groups
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.
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.
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.
Verified via repro steps.