Just so I understand this correctly;
In my situation, I have created a view class by extending kendo.Class, and when it initializes, it creates a surface reference and stores it to the view (this.surface =...). It also creates a root Group object, and attaches all shapes to it for display. Then it runs "surface.draw" to display the content.
I have a possible workflow where the user may want to completely destroy the surface and re-render it with new data (databinding, changing a model, etc.). In this situation, to clean up all memory used by this view that I have created, would this be sufficient:
I call "this.surface.destroy()" then "this.surface = null". Set the stored root group to null ("this.root = null") and then I clear out the HTML by doing: $("#canvas").unbind(); $("#canvas").innerHTML = ""; $("#canvas").remove();
My biggest concern in this situation is if we have an auto-refresh that redraws this view every x-seconds, I want to avoid any memory leaks.