Commits

Anonymous committed 8f7a8ad

Modified Files:
Tag: mm_fix
dom.c
[fix] Mem leak if text node is not refered by perl

example/libxml.xml
+ more documentation

Comments (0)

Files changed (2)

             next = node->next;
             xmlNodeAddContent(node, next->content);
             xmlUnlinkNode( next );
+
+            /**
+             * keep only nodes that are refered by perl (or GDOME)
+             */
+            if ( !next->_private )
+                xmlFreeNode( next );
         }
         break;
     case XML_ELEMENT_NODE:

example/libxml.xml

             <method name="getChildnodes"
                     synopsis="@children = $node->getChildnodes();">
                 <p>
+                    Alias for <st>childNodes()</st>
+                </p>
+            
+            </method>
+
+            <method name="childNodes"
+                    synopsis="@childnodes = $node->childNodes;">
+                <p>
                     <st>getChildnodes</st> implements a more intuitive
                     interface to the childnodes of the current
                     node. It enables you to pass all children directly
                     function is called in scalar context, the number
                     of childnodes will be returned.
                 </p>
-            </method>
-
-            <method name="childNodes"
-                    synopsis="@childnodes = $node->childNodes;">
-                <p>
-                    Alias for <st>getChildnodes()</st>
-                </p>
-            </method>
+                </method>
 
             <method name="toString"
                     synopsis="$xmlstring = $node->toString();">
                 </p>
             </method>
 
+            <method name="normalize" synopsis="$node->normalize">
+                 <p>
+                   This function normalizes adjacent textnodes. This
+                   function is not as strict as libxml2's
+                   xmlTextMerge() function, since it will not free a
+                   node that is still refered by the perl layer.
+                 </p>
+            </method>
+
         </description>
         <also>
             <item name="XML::LibXML"/>