Avoid memory leaks in dojo?

For long-running browser applications using a set of tools like dojo, I hear over and over again that dangling links should be avoided. But each language / structure has its own characteristics when managing memory.

How can I avoid dangling links when creating an application in dojo? I think about the rules on the principle of "alloc" in iOS: how to use and how to clean up after myself when this is done.

+5
source share
2 answers

I think the biggest thing that comes to dojo is that you should remember to disable any events that you are connecting.

, , dijit:

//connecting some events
this._events = [
    dojo.connect(...),
    dojo.connect(...)
];

:

dojo.forEach(this._events, dojo.disconnect, dojo);

this.connect dijit.

+2

, , , . , , , Dojo. "delete" . . .

+1

All Articles