| Summary: | IObjectActionDelegate use is problemmatic across multiple workbenches | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Austin Riddle <austin.riddle> | ||||||
| Component: | Workbench | Assignee: | Project Inbox <rap-inbox> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | critical | ||||||||
| Priority: | P3 | ||||||||
| Version: | 1.3 | ||||||||
| Target Milestone: | 1.3 RC3 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 7 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Austin Riddle
OK, I spoke too soon. Repeated tests show that in both 1.2 and 1.3 there is a shared delegate, it is just that it is "possible" for the instance to be different because of the workbench logic behind it. This is still a very difficult issue for us to grapple with because we have so many object delegates in our code. Created attachment 170520 [details]
Proposed fix
It seems that we have missed two singletons in the workbench: Turning the class ObjectActionContributorManager into a session singleton cures the problem, i.e. it results in separate IActionDelegate instances per user session.
Since Workbench#shutdown invokes dispose() on this singleton, I think it is clear that it is meant to have Workbench scope. The same is true for PropertyPageContributionManager.
Created attachment 170521 [details]
mylyn/context/zip
I'm convinced that the ObjectPluginAction instances (those are passed as parameter to the IObjectActionDelegate) should have session scope, as they contain state that is related to the workbench instance. I'm not quite sure about the solution. Although it is simple and looks reasonable, it leads to reading the extension registry once for every application. Not sure if there is some better way to do it. Please ignore the mylyn context, this slipped in here by accident. Committed patch to CVS HEAD. |