Opened 12 years ago

Closed 11 years ago

#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: high Milestone: 1.3
Component: General Version:
Keywords: 0.4.3 freed script IE Cc: amram@…
Blocked By: Blocking:

Description (last modified by dante)

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

Change History (5)

comment:1 in reply to:  description Changed 12 years ago by guest

Just a comment to say I have the same issue (but only with IE7).
My testcase is:
dojo and widgets in my page, an iframe with dojo too. Reloading the iframe leads to the javasript error.
I'm using dojo 0.4.2

Thanks for the workaround it works fine, now I am waiting for a definitive fix.

comment:2 Changed 11 years ago by dylan

Milestone: 0.4.41.2
Owner: changed from anonymous to dante

Please create a testcase for this with Dojo 1.1 and see if this is still relevant.

comment:3 Changed 11 years ago by dante

Description: modified (diff)
Milestone: 1.21.3
Priority: highnormal
severity: criticalnormal

Could this (if it is in fact still an issue) be related to #3242

Lowering priority of this ticket as no noise on it in a while ... Not sure how to make a test case ...

comment:4 Changed 11 years ago by guest

http://www.akatombo.com/en/comments/cant_execute_code_from_a_freed_script/

look at this. I ran into a similar problem and googled it - everybody;s having this same issue and it is not related to dojo. The solution is the following:

"FIXED! About 10 minutes after posting this I found the bizarre (to me, maybe someone can explain it) solution for this problem. It was as simple as moving any meta tags before the script tags in the head element of the html document. <script><meta> = heartache <meta><script> = salvation."

comment:5 Changed 11 years ago by bill

Resolution: invalid
Status: newclosed

Good, glad you found the solution. I'm closing this ticket; apparently there's nothing to do on dojo's end.

Note: See TracTickets for help on using tickets.