#14610 closed enhancement (fixed)
[patch][ccla]Add a dispose API to gfx
Reported by: | Patrick Ruzand | Owned by: | Patrick Ruzand |
---|---|---|---|
Priority: | high | Milestone: | 1.8 |
Component: | DojoX GFX | Version: | 1.7.1 |
Keywords: | Cc: | cjolif | |
Blocked By: | Blocking: |
Description
When a shape is not used anymore, some clean up operations might be needed to free resources and avoid leaks. One of the clean up tasks is for example to remove the shape from the ids registry (a hashmap that maps an idea to a shape instance, see dojox.gfx.shape.register). This cleanup operation cannot be done automatically on a container.clear/remove because removing a shape does not imply that the user wants to get rid of it (it might be a temporary state).
This enhancement ticket propose to add a dispose() api on the Shape class that would run the required cleanup tasks when called. Also, the clear/remove method signature could be updated to accept a extra boolean parameter indicating whether the node should be disposed.
see #14589
Attachments (2)
Change History (7)
comment:1 Changed 9 years ago by
Cc: | cjolif added |
---|
Changed 9 years ago by
Attachment: | 14610.patch added |
---|
comment:2 Changed 9 years ago by
Summary: | Add a dispose API to gfx → [patch][ccla]Add a dispose API to gfx |
---|
comment:3 Changed 9 years ago by
Status: | new → assigned |
---|
The proposed patch introduces a new Shape.destroy()* API that handles cleanup operations. In addition, Container.clear() has a new (optional) boolean parameter that indicates whether the children of a Group should be destroyed during the clear() operation. Note that before a shape is destroyed, it should be removed from its parent (this is done automatically by the Group for its children).
*: the new api is named destroy() and not dispose() as initially proposed for the sake of consistency with the existing Surface.destroy() method that has the very same purpose.
Changed 9 years ago by
Attachment: | test_lifecycle2.html added |
---|
a test case that endlessly create/destroy gfx hierarchy (100 objects) to track mlk.
patch (by pruzand, IBM, CCLA)