aboutsummaryrefslogtreecommitdiffstats
path: root/xpath.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2003-10-29 17:07:51 +0000
committerDaniel Veillard <veillard@src.gnome.org>2003-10-29 17:07:51 +0000
commit94394cd1e494f8d669b310748f54192268185c8d (patch)
treeed35460e96c72e9b2253ca08f4199a5edae01ab7 /xpath.c
parentb5a46da41dda383a419af6b42ea9190e40817f8a (diff)
downloadandroid_external_libxml2-94394cd1e494f8d669b310748f54192268185c8d.tar.gz
android_external_libxml2-94394cd1e494f8d669b310748f54192268185c8d.tar.bz2
android_external_libxml2-94394cd1e494f8d669b310748f54192268185c8d.zip
more fixes about unregistering objects applied patch from Mark Vakoc
* xpath.c: more fixes about unregistering objects * include/libxml/relaxng.h: applied patch from Mark Vakoc missing _cplusplus processing clause Daniel
Diffstat (limited to 'xpath.c')
-rw-r--r--xpath.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/xpath.c b/xpath.c
index 627fa20b..1284100f 100644
--- a/xpath.c
+++ b/xpath.c
@@ -2709,6 +2709,8 @@ xmlXPathRegisterFuncNS(xmlXPathContextPtr ctxt, const xmlChar *name,
ctxt->funcHash = xmlHashCreate(0);
if (ctxt->funcHash == NULL)
return(-1);
+ if (f == NULL)
+ return(xmlHashRemoveEntry2(ctxt->funcHash, name, ns_uri, NULL));
return(xmlHashAddEntry2(ctxt->funcHash, name, ns_uri, (void *) f));
}
@@ -2855,6 +2857,9 @@ xmlXPathRegisterVariableNS(xmlXPathContextPtr ctxt, const xmlChar *name,
ctxt->varHash = xmlHashCreate(0);
if (ctxt->varHash == NULL)
return(-1);
+ if (value == NULL)
+ return(xmlHashRemoveEntry2(ctxt->varHash, name, ns_uri,
+ (xmlHashDeallocator)xmlXPathFreeObject));
return(xmlHashUpdateEntry2(ctxt->varHash, name, ns_uri,
(void *) value,
(xmlHashDeallocator)xmlXPathFreeObject));
@@ -2975,7 +2980,7 @@ xmlXPathRegisterNs(xmlXPathContextPtr ctxt, const xmlChar *prefix,
if (ctxt->nsHash == NULL)
return(-1);
if (ns_uri == NULL)
- return(xmlHashRemoveEntry(ctxt->nsHash, ns_uri,
+ return(xmlHashRemoveEntry(ctxt->nsHash, prefix,
(xmlHashDeallocator)xmlFree));
return(xmlHashUpdateEntry(ctxt->nsHash, prefix, (void *) xmlStrdup(ns_uri),
(xmlHashDeallocator)xmlFree));