Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326111 - Workbench singletons must be disposed on shutdown
Summary: Workbench singletons must be disposed on shutdown
Status: CLOSED FIXED
Alias: None
Product: RAP
Classification: RT
Component: Workbench (show other bugs)
Version: 1.3   Edit
Hardware: PC All
: P2 normal (vote)
Target Milestone: 1.4 M5   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-24 00:33 EDT by Yury CLA
Modified: 2011-01-12 05:39 EST (History)
2 users (show)

See Also:


Attachments
WorkbenchPlugin patch (955 bytes, patch)
2010-09-24 00:35 EDT, Yury CLA
no flags Details | Diff
Patch to make wizard registries session singletons (4.86 KB, patch)
2011-01-03 16:37 EST, Ralf Sternberg CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yury CLA 2010-09-24 00:33:50 EDT
Build Identifier: RAP 1.3

There are 3 static WizardRegisties in WorkbenchPlugin. I think we must to dispose them while Workbench is closing (Workbench.shutdown()) and reseting WorkbenchPlugin. Supposed patch is applied.

Reproducible: Always
Comment 1 Yury CLA 2010-09-24 00:35:25 EDT
Created attachment 179493 [details]
WorkbenchPlugin patch
Comment 2 Yury CLA 2010-09-24 00:50:04 EDT
Actually, this WizardRegisties should be SessionSingletons and the proposed patch isn't full fixes for the issue. But anyway, wizards registries must be disposed on workbench shutdown to prevent memory leaks.
Comment 3 Ralf Sternberg CLA 2010-12-28 12:41:59 EST
Could you explain why these registries should have session scope? As far as I can see, they only keep wizard descriptors that are read from the extension registry, but do not reference any display.
Comment 4 Yury CLA 2010-12-29 00:54:12 EST
Ralf,

I mean that these registries shouldn't be singletons. They are created once than user start session (workbench starting) and should be disposed on session ending (workbench shutdown). If we keep them singletons - first user load wizard descriptors/categories and localize their names (and other parameters) using its own locale settings, second user will get these cached registries in singleton instances. Than I sad SessionSingletons it doesn't exactly consider using SessionSingletonBase class, but mean read registries on user session start and dispose them on its ending. For example, we get this problem for "Other" wizard category. Investigating this problem encourage me to file this issue.

Best regards,
Yury.
Comment 5 Ralf Sternberg CLA 2011-01-03 16:37:13 EST
Created attachment 185975 [details]
Patch to make wizard registries session singletons

I see that these three registries should be session singletons:
* ExportWizardRegistry
* ImportWizardRegistry
* NewWizardRegistry

However, AbstractExtensionWizardRegistry#dispose() is never called in RCP. I wonder if we have to. With the patch the registries seem to be cleaned up at session timeout already.
Comment 6 Ralf Sternberg CLA 2011-01-11 10:55:15 EST
Yury, would be great if you could have a look at the patch. Let me know whether it works for you.
Comment 7 Yury CLA 2011-01-12 03:20:24 EST
Hi, Ralf.

I've checked your fixes and it works. 
But one moment we have to do also: WizardsRegistryReader.UNCATEGORIZED_WIZARD_CATEGORY_LABEL static field should be removed and WorkbenchMessages.get().NewWizardsRegistryReader_otherCategory should be used in WizardsRegistryReader.moveElementToUncategorizedCategory method (for correct localization).

Best regards,
Yury.
Comment 8 Ralf Sternberg CLA 2011-01-12 05:39:44 EST
Good catch! Thanks for the feedback. Applied 2nd patch to CVS HEAD and inlined the constant as suggested.