Description
Feature Description:
In BaseWidget.onCloseRequested()
we invoke the dispose()
method in the widget. I believe this is wrong, due to the argument in #12093 (comment):
when a client invokes ApplicationShell.addWidget(), it can pass widgets which are not derived from BaseWidget. When we later call ApplicationShell.closeWidget() on that widget, we should invoke dispose() on the widget after calling close() on it, since we do not know that close() invokes dispose(). Currently, any widget that does not dispose itself upon close() will go undisposed and might leak resources. However, calling dispose() on a BaseWidget after it is close will double-dispose and throw an error.
The clients managing the widget lifecycle should be reponsible for disposing of the widgets, not the widget itself.
Activity