diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2003-10-29 17:07:51 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2003-10-29 17:07:51 +0000 |
commit | 94394cd1e494f8d669b310748f54192268185c8d (patch) | |
tree | ed35460e96c72e9b2253ca08f4199a5edae01ab7 /xpath.c | |
parent | b5a46da41dda383a419af6b42ea9190e40817f8a (diff) | |
download | android_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.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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)); |