Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 278624

Summary: [WorkbenchParts] Outline view disposal order different on Windows and Mac Cocoa
Product: [Eclipse Project] Platform Reporter: Peter Friese <peter>
Component: UIAssignee: Paul Webster <pwebster>
Status: RESOLVED WORKSFORME QA Contact: Paul Webster <pwebster>
Severity: critical    
Priority: P3 CC: bokowski, cocoakevin, dan.stefanescu, daniel_megert, john.arthorne, ob1.eclipse, sebastian.zarnekow
Version: 3.5   
Target Milestone: 3.5.1   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:

Description Peter Friese CLA 2009-06-01 10:45:40 EDT
One of our users filed a bug basically stating that out outline disposed of its content provider and not regaining access to the provider again when re-openeing the outline view (see bug 278279 for more info). As I could not reproduce the bug on my machine (using Eclipse 3.5 RC3 Cocoa), I installed Eclipse 3.5 RC3 on a Windows box. Voilá - the bug appeared.

On Windows, Page.dispose() will be called just after closing the outline view (which is the expected behaviour), while on Mac OS Cocoa, Page.dispose() will only be invoked after the corresponding editor has been closed.

Steps to reproduce:
1) Create a dummy plug-in project and add a dependency to org.eclipse.ui.views
2) Open Page.class
3) Set a breakpoint in line 70 (i.e. the first line in Page.dispose() )
4) Start a runtime workbench
5) Create a new Java project
6) Create a new java class
7) Open the Java class, making sure the Outline is visible
8) Close the outline

On Windows, you will be taken to the breakpoint immediately.
On MacOS Cocoa, you'll have to close the Java editor to trigger the disposal of the Outline view.

I suggest to ensure the disposal order is the same on all platforms. As the disposal order on Windows feels quite natural to me, I'd suggest to stick with it.
Comment 1 John Arthorne CLA 2009-06-02 11:33:40 EDT
Removing target milestone - this should only be set by a committer on this component.
Comment 2 Boris Bokowski CLA 2009-06-18 07:46:20 EDT
Should be investigated for 3.5.1.
Comment 3 Paul Webster CLA 2009-08-10 10:09:32 EDT
Oleg, could you please see if you can reproduce this behaviour on your Mac?

PW
Comment 4 Oleg Besedin CLA 2009-08-10 11:31:59 EDT
(In reply to comment #0)
> On Windows, Page.dispose() will be called just after closing the outline view
> (which is the expected behaviour), while on Mac OS Cocoa, Page.dispose() will
> only be invoked after the corresponding editor has been closed.

That's not what I see. Both Mac and Windows behave the same way for me; but keep in mind that Page.dispose() is triggered when the reference counter for that view goes to 0.

What you probably see is produced by the difference in the number of open perspectives. Consider two cases:

A. Only one perspective is open: Java. There is only one reference to the outline view; the Page#dispose() is called when the Outline view is closed in Java perspective.

B. Two perspectives are open: Java and Resources. Both perspectives contain Outline view. Closing Outline view in the Java perspective reduces its reference count from 2 to 1; the Oultine still stays open - unless you close it in the Resources perspective too.

(Note that for this angle, Perspective is considered "open" if you have ever opened it in the past; you can see the list of them in the perspective chooser toolbar.)
Comment 5 Paul Webster CLA 2009-08-11 09:38:09 EDT
Please re-open with the specific one perspective usecase if it still occurs.

PW