I have a situation where a user presses a button and depending on the
class involved, a new FlexTable is constructed with various new
widgets. Since this Table is constructed a number of times during the
application, I'm wondering about resources.
Are the objects I create for the table garbage collected similar to
Java or am I going to find my app bogging down because the objects are
never destroyed when the new ones take their place?
Cheers,
-Elam
What I'm wondering is the following - does GWT recognize these cases
and take care of them appropriately
Yes! The widget architecture is designed to avoid memory leaks in IE.
So, you can use widgets freely without worrying about leaks.
JSNI is somewhat riskier, depending on what you do. If you use JSNI to
set up event handlers, for example, you can accidentally re-introduce
leaks if you aren't careful. That's why we recommend using composites
of existing widgets as much as possible, since composites won't leak.
Keep in mind that writing JSNI is just like writing any raw
JavaScript...it's powerful but there's less GWT can do to help you
automatically.
See
<http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.UserInterface.CreatingCustomWidgets.html>
for details on building widgets using composites.
-- Bruce