Re: PieChart stays in detached DOM tree when removed from parent widget
On Tuesday, December 3, 2013 2:44:50 PM UTC-6, ak...@ualberta.net wrote:
I posted this to Stackoverflow and to the gwt-vizualization team as a possible bug, 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
Button
s and aVerticalPanel
(accessed by the presenter asdisplay.getPanel()
). One button adds aPieChart
to theVerticalPanel
, the the other removes it. The presenter holds thePieChart
reference as aWidget
so that it knows when it has been added/removed. It is initialized tonull
.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 aLabel
instead of aPieChart
, 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:
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 google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home