Ticket #3697 (closed defect: invalid)
"Can't execute code from a freed script" with IE6 and IE7 and dojo 0.4.3
| Reported by: | guest | Owned by: | dante |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.3 |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | 0.4.3 freed script IE |
| Cc: | amram@… |
Description (last modified by dante) (diff)
Hi,
I have a complex layout with an html frame using dojo, itself including iframes and plenty of javascript.
I faced a FATAL "Can't execute code from a freed script" on IE (not firefox, works fine) at some occasion when page reloads, due to some windows disappearing before dojo had time to "unregister them" apparently.
To solve this, I had to add 3 try {} catch blocks:
1/ In src/event/common.js, line 313:
REPLACE
mjp.kwAddAdvice(ao);
BY
try { mjp.kwAddAdvice(ao); } catch (e) { return null; }
2/ In src/event/common.js, line 452:
REPLACE
mjp.removeAdvice(ao.adviceObj, ao.adviceFunc, ao.adviceType, ao.once);
BY
try { mjp.removeAdvice(ao.adviceObj,ao.adviceFunc,ao.adviceType,ao.once); } catch (e) { return null; }
3/ In src/widget/PopupContainer.js, line 376
SURROUND THE BLOCK lines 376-382 WITH
try { if(win.PopupManagerRegistered){ dojo.event.disconnect(win.document,"onmousedown",this,"onClick"); dojo.event.disconnect(win,"onscroll",this,"onClick"); dojo.event.disconnect(win.document,"onkey",this,"onKey"); win.PopupManagerRegistered=false; } } catch (e) {}
Hope it helps, and bravo for this marvelous toolkit!!
--Eric