I am creating a new presenter, for example:
new MyPresenter(new MyView());
It registers some event handlers and binds them to a view and the like. In the end, I could βcloseβ this view so that the browser would no longer be displayed by the browser. I do not maintain a link to this instance of MyPresenter
anywhere.
In the Google forums in this section, the usual answer is βset links to zero,β then don't worry about it. Unlike Javascript, I can just say this = null;
in Java for obvious reasons. But in Javascript, it is very easy to exclude references to objects that, as I know, will no longer be used.
My question is: how can I find out if this host was garbage collected because I do not support the link to it? It very clearly exists. Do I have to believe that GWT and JS will take care of this? Or do I need to save my own link to MyPresenter
so that I can manually null
it when I am done with it?
source share