Skip to content

I20220427-0040

@jonahgraham jonahgraham tagged this 26 Apr 12:55
The individual checks in this class do "button.getShell().dispose();"
to close the dialog when an assertion fails. That closes the UI
resources, but it does not dispose the non-UI resources/references.

In this particular case when
UIComparePreferencesAuto.testCompareViewersPref failed, it left
org.eclipse.jface.preference.PreferenceNode.page
set to the now disposed General preference page. So when a later
test tries to open the dialog, the test fails due to disposed widget
error.

By calling dialog.close() it makes sure that
org.eclipse.jface.preference.PreferenceNode.disposeResources()
is called, which releases the reference in PreferenceNode.page
Assets 2
Loading