-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better memory cleanup mechanism and implementation. Some generation c…
…leanup.
- Loading branch information
Showing
7 changed files
with
49 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
define(['modElem'], function( modElem ) { | ||
var mStyle = modElem.style; | ||
define(['Modernizr', 'modElem'], function( Modernizr, modElem ) { | ||
var mStyle = { | ||
style : modElem.elem.style | ||
}; | ||
|
||
// kill ref for gc, must happen before | ||
// mod.elem is removed, so we unshift on to | ||
// the front of the queue. | ||
Modernizr._q.unshift(function() { | ||
delete mStyle.style; | ||
}); | ||
|
||
return mStyle; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
define(['createElement'], function(createElement) { | ||
define(['Modernizr', 'createElement'], function( Modernizr, createElement ) { | ||
/** | ||
* Create our "modernizr" element that we do most feature tests on. | ||
*/ | ||
var modElem = createElement('modernizr'); | ||
var modElem = { | ||
elem : createElement('modernizr') | ||
}; | ||
|
||
// Clean up this element | ||
Modernizr._q.push(function() { | ||
delete modElem.elem; | ||
}); | ||
|
||
return modElem; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
define(['mStyle'], function( mStyle ) { | ||
define(['Modernizr', 'mStyle'], function( Modernizr, mStyle ) { | ||
/** | ||
* setCss applies given styles to the Modernizr DOM node. | ||
*/ | ||
function setCss( str ) { | ||
mStyle.cssText = str; | ||
mStyle.style.cssText = str; | ||
} | ||
|
||
// Clean up used to happen, but probably isn't | ||
// necessary since we delete the element | ||
/*Modernizr._q.unshift(function(){ | ||
setCss(''); | ||
});*/ | ||
|
||
return setCss; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters