| Summary: | Debug leaks WorkbenchWindow | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Markus Keller <markus.kell.r> | ||||||
| Component: | Debug | Assignee: | Pawel Piech <pawel.1.piech> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | daniel_megert, darin.eclipse, pawel.1.piech, remy.suen | ||||||
| Version: | 3.7 | Flags: | pawel.1.piech:
review+
|
||||||
| Target Milestone: | 3.7 M2 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Mac OS X | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Markus Keller
Created attachment 175855 [details]
Patch with leak fixes.
In addition to the leaks pointed out I also found:
- ToggleStepFilter action is never disposed.
- PresentationContext doesn't reset fWindow on dispose
- ViewContextService doesn't reset fWindow on dispose
- SourceLookupService doesn't reset fWindow on dispose
The reason that the mentioned hash maps don't remove the reference upon windowClosed() call, as pointed out, is that those managers are often called by clients with a cached reference to the closed window. When that happens the managers end up creating a new service instance for that window and thus leak the window reference anyway. The simplest solution I can think of is to have these managers hold a weak reference to the window instead. Any objections?
Comment on attachment 175855 [details]
Patch with leak fixes.
I forgot to set the review flag. Darin, could you take a look at these changes and let me know what you think. I'll be away for next three weeks so if you like the changes please go ahead and apply them.
Sure, I'll take a look once M1 has shipped. Created attachment 176056 [details]
patch
You can avoid using weak hash maps with this patch. A "null" debug context service is returned when a window has been closed. Not sure which approach is better.
I released the 2nd patch for now. All tests pass. I'm not crazy about the weak references either, so the null-service approach seems like a good idea to me. Reviewed. |