Opened 11 years ago

Closed 8 years ago

#7843 closed defect (fixed)

leak in dijit.registerWin

Reported by: liucougar Owned by:
Priority: high Milestone: 1.4
Component: Dijit Version: 1.2.0
Keywords: Cc:
Blocked By: Blocking:

Description

no dojo.disconnect corresponds to the dojo.connect in dijit.registerWin

this leads to leaks in at least IE, I think we need to take care of that

Attachments (1)

focus.js.diff (921 bytes) - added by coldwind 11 years ago.
Patch for solving memory leaks in IE, not sure that it's right solution

Download all attachments as: .zip

Change History (8)

comment:1 Changed 11 years ago by bill

Milestone: tbdfuture

Hmm, feel free to work on this.

It's a bit troublesome though... we would need a deregisterWindow() call to complement registerWin(), and perhaps change registerWin() to return a handle... then change all the calling code.

comment:2 in reply to:  1 ; Changed 11 years ago by coldwind

Replying to bill:

Hmm, feel free to work on this.

It's a bit troublesome though... we would need a deregisterWindow() call to complement registerWin(), and perhaps change registerWin() to return a handle... then change all the calling code.

Why there is dojo.connect only for 'onmousedown' event, but 'onactivate', 'focus' and etc. are using doc.attachEvent for IE and doc.addEventListener for other?

When I rewrite registering of 'onmousedown' and used jsleaksdetector it shows that there is no memory leak.

I am not sure that my solution was right. Why there used dojo.connect instead of using direct methods?

Changed 11 years ago by coldwind

Attachment: focus.js.diff added

Patch for solving memory leaks in IE, not sure that it's right solution

comment:3 Changed 11 years ago by coldwind

Sorry, previous patch breaks down work in FF... :(

comment:4 in reply to:  2 Changed 11 years ago by bill

Replying to coldwind:

Why there is dojo.connect only for 'onmousedown' event, but 'onactivate', 'focus' and etc. are using doc.attachEvent for IE and doc.addEventListener for other?

FYI, AFAIK I could have used attachEvent()/addEventListener() for onmousedown. I just used dojo.connect() because it's used everywhere in dojo.

The reason I _didn't_ use dojo.connect() for detecting focus is that a dojo.connect() on the <body> node won't work, because focus events don't bubble (except via attachEvent()/addEventListener()).

comment:5 Changed 10 years ago by Shane O'Sullivan

(In [17957]) Refs #7843 Fixes the issue where the Gallery calls a non-existent method "toggleSlideshow" on the SlideShow? widget.

comment:6 Changed 10 years ago by Shane O'Sullivan

Apologies, I added the wrong ticket reference to a checkin. It should have been #7873

comment:7 Changed 8 years ago by bill

Milestone: future1.4
Resolution: fixed
Status: newclosed

This was fixed in 1.4, which incidentally switches to using native calls (instead of dojo.connect()) to monitor onmousedown.

Note: See TracTickets for help on using tickets.