[xml] Segfault freeing doc after replaceNode() in python

The attached script is a copy of the included python test file cutnpaste.py with two important differences:

1) It uses replaceNode() instead of addChild() to put the 'cut' node into the destination document

2) It segfaults :(

My guess is that somehow the cut/replaced node is being freed twice. If I comment out the freeDoc line for either the source or target it stops segfaulting (but then of course, leaks memory).

Any ideas?



"The programmer, like the poet, works only slightly removed from pure
 thought-stuff.  He builds his castles in the air, from air, creating
 by exertion of the imagination.  Few media of creation are so
 flexible, so easy to polish and rework, so readily capable of
 realizing grand conceptual structures."
                        -- Frederick Brooks, Jr., The Mythical Man Month

Attachment: replace.py
Description: application/python

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]