[Ieleak-commit] SF.net SVN: ieleak: [138] trunk/drip/src
Brought to you by:
matthiasmiller
From: <mat...@us...> - 2006-09-12 23:33:36
|
Revision: 138 http://svn.sourceforge.net/ieleak/?rev=138&view=rev Author: matthiasmiller Date: 2006-09-12 16:33:29 -0700 (Tue, 12 Sep 2006) Log Message: ----------- don't cache text nodes since they cannot be leaked without references to other nodes, and since referencing the ownerDocument property after other nodes are freed can cause crashes Modified Paths: -------------- trunk/drip/src/JSHook.cpp trunk/drip/src/tests/textNodeTest.html Modified: trunk/drip/src/JSHook.cpp =================================================================== --- trunk/drip/src/JSHook.cpp 2006-09-12 12:21:35 UTC (rev 137) +++ trunk/drip/src/JSHook.cpp 2006-09-12 23:33:29 UTC (rev 138) @@ -90,12 +90,12 @@ // saves a references to the element and adds it to the DOM after the page is loaded.) // if (m_nodes.find(unk) == m_nodes.end()) { - Node cachedNode(SysAllocString(doc->url)); - m_nodes.insert(std::pair<IUnknown*,Node>(unk,cachedNode)); - - // Text nodes have no expandos or events. + // Text nodes have no expandos or events and thus cannot leak. // if (node->nodeType != 3/*TEXT*/) { + Node cachedNode(SysAllocString(doc->url)); + m_nodes.insert(std::pair<IUnknown*,Node>(unk,cachedNode)); + // Create a temporary parameter list to pass the node to the script, // in order to so attach events and override functions // Modified: trunk/drip/src/tests/textNodeTest.html =================================================================== --- trunk/drip/src/tests/textNodeTest.html 2006-09-12 12:21:35 UTC (rev 137) +++ trunk/drip/src/tests/textNodeTest.html 2006-09-12 23:33:29 UTC (rev 138) @@ -17,5 +17,6 @@ </script> </head> <body> +Text nodes are not reported, even though they are leaked. </body> </html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |