Changeset 533
- Timestamp:
- 07/22/06 13:31:22 (7 years ago)
- Files:
-
- 1 modified
-
trunk/htmlarea.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/htmlarea.js
r532 r533 200 200 panels[i].container.className = 'panels ' + i; 201 201 HTMLArea.freeLater(panels[i], 'container'); 202 HTMLArea.freeLater(panels[i], 'div'); 202 HTMLArea.freeLater(panels[i], 'div'); 203 203 } 204 204 // finally store the variable 205 205 this._panels = panels; 206 206 207 207 HTMLArea.freeLater(this, '_textArea'); 208 208 } … … 6712 6712 }; 6713 6713 6714 HTMLArea.free = function(obj, prop) 6715 { 6716 if ( obj && !prop ) 6717 { 6718 for ( var p in obj ) 6719 { 6720 HTMLArea.free(obj, p); 6721 } 6722 } 6723 else if ( obj ) 6724 { 6714 /** 6715 * Release memory properties from object 6716 * @param {object} O (Object) The object to free memory 6717 * @param (string} P (Property) The property to release (optional) 6718 * @private 6719 */ 6720 HTMLArea.free = function(O, P) 6721 { 6722 if ( O && !P ) 6723 { 6724 for ( var p in O ) 6725 { 6726 HTMLArea.free(O, p); 6727 } 6728 } 6729 else if ( O ) 6730 { 6731 // is the try...catch really required here ? 6725 6732 try 6726 6733 { 6727 obj[prop] = null; 6728 } catch(ex) {} 6734 // if the property is innerHTML, null can't be used because it is interpreted as null.toString() 6735 // we need to blank it instead 6736 if ( P == 'innerHTML' ) 6737 { 6738 O[P] = ''; 6739 } 6740 else 6741 { 6742 // need to unhide TD cells before delete them or they will leak in IE 6743 if ( P && O[P] && O[P].tagName && O[P].tagName.toLowerCase() == 'td' ) 6744 { 6745 O[P].style.display = ''; 6746 } 6747 O[P] = null; 6748 } 6749 } catch(x) {} 6729 6750 } 6730 6751 };
