* Source/NSXMLNode.m (+initialize): Add workaround for Windows

xmlFree problem.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34897 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2012-03-06 22:33:54 +00:00
parent efdaa9502e
commit 61002f572e
2 changed files with 17 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2012-03-06 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSXMLNode.m (+initialize): Add workaround for Windows
xmlFree problem.
2012-03-06 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSURLProtocol.m: check for parse complete explicitly and

View file

@ -587,6 +587,17 @@ execute_xpath(NSXMLNode *xmlNode, NSString *xpath_exp, NSString *nmspaces)
@implementation NSXMLNode
+ (void) initialize
{
xmlCheckVersion(LIBXML_VERSION);
// Protect against libxml2 not being correctly set up on Windows.
// See: http://www.linuxquestions.org/questions/programming-9/%5Bsolved%5Dusing-libxml2-on-mingw-xmlfree-crashes-839802/
if (!xmlFree)
{
xmlMemGet(&xmlFree, &xmlMalloc, &xmlRealloc, NULL);
}
}
+ (id) attributeWithName: (NSString*)name
stringValue: (NSString*)stringValue
{
@ -768,6 +779,7 @@ execute_xpath(NSXMLNode *xmlNode, NSString *xpath_exp, NSString *nmspaces)
n = [[[self alloc] initWithKind: NSXMLProcessingInstructionKind] autorelease];
[n setStringValue: stringValue];
[n setName: name];
return n;
}