DESCRIPTION

Bug 498275 - PropertySheetPage#dispose() should unregister listeners

To avoid memory leaks, properly cleanup all the possible references to
other objects from PropertySheetPage and PropertySheetViewer on
dispose().

Change-Id: I210624ebdb062fe5010d2a5568e2bc17397b292a
Signed-off-by: Jayvion Booth xxx@xxx.xxx


COMMENTS

author: Jayvion Booth
date: 2016-07-21 13:52:57.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2016-07-21 13:53:03.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/9951/

-------------------------------------
author: Daniel Kelly
date: 2016-07-21 14:00:10.000000000

Patch Set 2:

(1 comment)

I have commented were bug #498274  could lead to an improvement. The listener references seem to be properly unregistered now (I will have to check the updated patch in my profiler yet). 

Where is the proper place to dispose the actions? Should the viewer references of the actions not be removed in their dispose() methods?

Line:1422, bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheetViewer.java -> This is what I was planning to accomplish with bug #498274. We should simply call setRootEntry(null) here, if setRootEntry(would accept a null argument). Thereby we would not have to double the code to remove the entry listener.

-------------------------------------
author: Daniel Kelly
date: 2016-07-21 14:03:50.000000000

Patch Set 2:

It seems PropertySheetActions are not disposable, so unsetting their viewer references is probably sufficient. But where are they removed from the toolbarManager again? Does that happen outside or would it be responsibility of PropertySheetPage to remove them again (as it adds them).

-------------------------------------
author: Brenden Conley
date: 2016-07-21 14:20:02.000000000

Patch Set 2: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/9951/ : SUCCESS

-------------------------------------
author: Jayvion Booth
date: 2016-07-21 14:35:34.000000000

Patch Set 2:

(1 comment)

> It seems PropertySheetActions are not disposable, so unsetting
 > their viewer references is probably sufficient. But where are they
 > removed from the toolbarManager again? Does that happen outside or
 > would it be responsibility of PropertySheetPage to remove them
 > again (as it adds them).

The toolbar manager should clear all contributions.

Line:1422, bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheetViewer.java -> The problem is that setRootEntry(null) will require more code changes, javadoc changes (it is a public API) AND it will change behavior => much more possible side effects.

Removing a listener here is not that much of code duplication.

-------------------------------------
author: Jayvion Booth
date: 2016-07-21 14:35:48.000000000

Patch Set 3: Patch Set 2 was rebased

-------------------------------------
author: Gerrit Code Review
date: 2016-07-21 15:23:31.000000000

Change has been successfully merged into the git repository by Jayvion Booth

-------------------------------------
