fixed bug 20229; r=beard. Special thanks to patrick for his persistence with leaks.

git-svn-id: svn://10.0.0.236/trunk@55132 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rickg%netscape.com
1999-12-03 00:33:17 +00:00
parent a836e61b39
commit d3a9108ad8
2 changed files with 22 additions and 4 deletions

View File

@@ -78,12 +78,21 @@ static void RecycleTokens(nsITokenRecycler* aRecycler,nsDeque& aDeque) {
* @return
*/
nsCParserNode::~nsCParserNode() {
if(mRecycler && mAttributes) {
RecycleTokens(mRecycler,*mAttributes);
if(mAttributes) {
//fixed a bug that patrick found, where the attributes deque existed
//but was empty. In that case, the attributes deque itself was leaked.
//THANKS PATRICK!
if(mRecycler) {
RecycleTokens(mRecycler,*mAttributes);
}
delete mAttributes;
mAttributes=0;
}
}
NS_IMPL_ADDREF(nsCParserNode)
NS_IMPL_RELEASE(nsCParserNode)