This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
There is serious problem in our implementation of DialogDisplayer in o.n.core.windows.services. Dialogs provided by this service are not disposed when user closes them so they are retained in memory by reference from their native peer. This is cause of bugs like issue #55015. Note that org.openide.DialogDisplayer$Trivial implementation do not suffer from this and the code here is correct
This is kind of regression coming from fix for issue #49467. Probably we should clarify in documentation what is the policy when the dialog is closed and allow users to modify this behaviour correctly. The default should be dispose on close as it will prevent possible leaks. Places where dialog is reused should work even with dispose calls but it will be better for them to override this option. Anyway we may need to check how many places in our codebase reuses dialogs so it might be better to do it for next release.
Should be harmless to dispose DialogDisplayer's dialog after it's been closed - shouldn't cause any harm.
Created attachment 27573 [details] a patch
I attached a simple patch but the covering test still fails.
Checking in NbPresenter.java; /shared/data/ccvs/repository/core/windows/src/org/netbeans/core/windows/services/NbPresenter.java,v <-- NbPresenter.java new revision: 1.27; previous revision: 1.26 done