r111697 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111696‎ | r111697 | r111698 >
Date:22:56, 16 February 2012
Author:catrope
Status:ok
Tags:
Comment:
Move the IE memory leak prevention voodoo together to after the callback, and put it in a try catch block. The first statement after the callback seems to mysteriously fail in IE7 sometimes with a permission denied error. I think the root cause might be the fact that the callback itself also calls addScript()
Modified paths:
  • /trunk/phase3/resources/mediawiki/mediawiki.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/mediawiki/mediawiki.js
@@ -648,17 +648,21 @@
649649
650650 done = true;
651651
652 - // Handle memory leak in IE
653 - script.onload = script.onreadystatechange = null;
654 -
655652 callback();
656653
657 - if ( script.parentNode ) {
658 - script.parentNode.removeChild( script );
659 - }
660 -
661 - // Dereference the script
662 - script = undefined;
 654+ // Handle memory leak in IE. This seems to fail in
 655+ // IE7 sometimes (Permission Denied error when
 656+ // accessing script.parentNode) so wrap it in
 657+ // a try catch.
 658+ try {
 659+ script.onload = script.onreadystatechange = null;
 660+ if ( script.parentNode ) {
 661+ script.parentNode.removeChild( script );
 662+ }
 663+
 664+ // Dereference the script
 665+ script = undefined;
 666+ } catch ( e ) { }
663667 }
664668 };
665669 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r111699MFT r111695, r111697reedy23:02, 16 February 2012
r112027MFT r111580, r111695, r111697, r111832, r112021reedy17:29, 21 February 2012

Status & tagging log