I posted this to Stackoverflow <http://stackoverflow.com/q/20129862/770519>and 
to the gwt-vizualization team as a possible 
bug <http://code.google.com/p/gwt-google-apis/issues/detail?id=529>, but I 
have not received any replies from either post.  Perhaps someone here has 
some insight into what is going on, or knows someone on the gwt-google-api 
team, or is on the team.

I have an MVP GWT 2.5.1 app using version 1.1.1 of gwt-visualization. My 
view has two Buttons and a VerticalPanel (accessed by the presenter as 
display.getPanel()). One button adds a PieChart to the VerticalPanel, the 
the other removes it. The presenter holds the PieChart reference as a Widgetso 
that it knows when it has been added/removed. It is initialized to 
null.

I checked chrome's dev tools to ensure that the add/remove code wasn't 
creating a DOM leak. But after the PieChart was removed, its elements were 
left behind in a detached DOM tree, all color coded red. When I tried the 
same add/remove code with a Label instead of a PieChart, no detached DOM 
tree remained after removal.

I have a project on github that will reproduce this:

git clone https://github.com/akydd/GWT-experiments.git

Clone, build it, and deploy it so it can be run in Production mode.  It 
should have the following URL if deployed to the root folder of your local 
webserver: http://127.0.0.1/WidgetAddDelete.html.  Open it up in Chrome.

To see the issue, click the button on the first screen.  You should now see 
multiple buttons on screen.  Click "Add chart", wait for the chart to draw, 
then click "Remove chart".  Using Chrome's dev tools, take a heap 
snapshot.  You should see about 36 elements in the detached DOM tree that 
are left over from the removed PieChart:

<https://lh5.googleusercontent.com/-Y1HQk_ZEjW4/Up5CgM_qnlI/AAAAAAAAAA4/EsZB2I9nExU/s1600/Screen+Shot+2013-12-03+at+1.38.30+PM.png>

It looks to me that there is a DOM leak with the PieChart widget.  Can 
someone confirm?  Or perhaps there is another way that I should be removing 
the PieChart widget?  I'm using the HasWidgets interface methods add(Wudget 
w) and remove(Widget w) to add and remove, respectively.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to