mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
use clearPrivatePointers() in NSXMLDocument as well as NSXMLNode when copying
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/nsxml_using_libxml2@34518 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
990bd6274c
commit
f6289a65a1
2 changed files with 16 additions and 13 deletions
|
@ -29,6 +29,17 @@
|
|||
#import "GSInternal.h"
|
||||
GS_PRIVATE_INTERNAL(NSXMLNode)
|
||||
|
||||
void clearPrivatePointers(xmlNodePtr aNode)
|
||||
{
|
||||
if (!aNode)
|
||||
return;
|
||||
aNode->_private = NULL;
|
||||
clearPrivatePointers(aNode->children);
|
||||
clearPrivatePointers(aNode->next);
|
||||
if (aNode->type == XML_ELEMENT_NODE)
|
||||
clearPrivatePointers((xmlNodePtr)(aNode->properties));
|
||||
}
|
||||
|
||||
// Private methods to manage libxml pointers...
|
||||
@interface NSXMLNode (Private)
|
||||
- (void *) _node;
|
||||
|
@ -340,17 +351,6 @@ GS_PRIVATE_INTERNAL(NSXMLNode)
|
|||
return childrenArray;
|
||||
}
|
||||
|
||||
static void clearPrivatePointers(xmlNodePtr aNode)
|
||||
{
|
||||
if (!aNode)
|
||||
return;
|
||||
aNode->_private = NULL;
|
||||
clearPrivatePointers(aNode->children);
|
||||
clearPrivatePointers(aNode->next);
|
||||
if (aNode->type == XML_ELEMENT_NODE)
|
||||
clearPrivatePointers((xmlNodePtr)(aNode->properties));
|
||||
}
|
||||
|
||||
- (id) copyWithZone: (NSZone*)zone
|
||||
{
|
||||
id c = [[self class] allocWithZone: zone];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue