mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
fixed thread problem
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
Fri Nov 22 13:13:00 HKT 2002 William Brack <wbrack@mmm.com.hk>
|
||||||
|
|
||||||
|
* threads.c: fixed initialization problem in xmlNewGlobalState
|
||||||
|
which was causing crash.
|
||||||
|
* globals.c: removed duplicate call to initxmlDefaultSAXHandler
|
||||||
|
in xmlInitializeGlobalState.
|
||||||
|
* parserInternals.c: cleaned up ctxt->sax initialisation.
|
||||||
|
|
||||||
Thu Nov 21 15:05:45 CET 2002 Daniel Veillard <daniel@veillard.com>
|
Thu Nov 21 15:05:45 CET 2002 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* tree.c include/libxml/tree.h: modified the existing APIs
|
* tree.c include/libxml/tree.h: modified the existing APIs
|
||||||
|
@ -409,7 +409,7 @@ xmlInitializeGlobalState(xmlGlobalStatePtr gs)
|
|||||||
/*
|
/*
|
||||||
* Perform initialization as required by libxml
|
* Perform initialization as required by libxml
|
||||||
*/
|
*/
|
||||||
initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1);
|
|
||||||
#ifdef LIBXML_DOCB_ENABLED
|
#ifdef LIBXML_DOCB_ENABLED
|
||||||
initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler);
|
initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler);
|
||||||
#endif
|
#endif
|
||||||
|
@ -2146,8 +2146,6 @@ xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename) {
|
|||||||
void
|
void
|
||||||
xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
|
xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
|
||||||
{
|
{
|
||||||
xmlSAXHandler *sax;
|
|
||||||
|
|
||||||
if(ctxt==NULL) {
|
if(ctxt==NULL) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
"xmlInitParserCtxt: NULL context given\n");
|
"xmlInitParserCtxt: NULL context given\n");
|
||||||
@ -2156,13 +2154,13 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
|
|||||||
|
|
||||||
xmlDefaultSAXHandlerInit();
|
xmlDefaultSAXHandlerInit();
|
||||||
|
|
||||||
sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
|
ctxt->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
|
||||||
if (sax == NULL) {
|
if (ctxt->sax == NULL) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
"xmlInitParserCtxt: out of memory\n");
|
"xmlInitParserCtxt: out of memory\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
memset(sax, 0, sizeof(xmlSAXHandler));
|
memcpy(ctxt->sax, &xmlDefaultSAXHandler, sizeof(xmlSAXHandler));
|
||||||
|
|
||||||
/* Allocate the Input stack */
|
/* Allocate the Input stack */
|
||||||
ctxt->inputTab = (xmlParserInputPtr *)
|
ctxt->inputTab = (xmlParserInputPtr *)
|
||||||
@ -2250,10 +2248,6 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
|
|||||||
ctxt->spaceMax = 10;
|
ctxt->spaceMax = 10;
|
||||||
ctxt->spaceTab[0] = -1;
|
ctxt->spaceTab[0] = -1;
|
||||||
ctxt->space = &ctxt->spaceTab[0];
|
ctxt->space = &ctxt->spaceTab[0];
|
||||||
|
|
||||||
ctxt->sax = sax;
|
|
||||||
memcpy(sax, &xmlDefaultSAXHandler, sizeof(xmlSAXHandler));
|
|
||||||
|
|
||||||
ctxt->userData = ctxt;
|
ctxt->userData = ctxt;
|
||||||
ctxt->myDoc = NULL;
|
ctxt->myDoc = NULL;
|
||||||
ctxt->wellFormed = 1;
|
ctxt->wellFormed = 1;
|
||||||
@ -2264,7 +2258,7 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
|
|||||||
ctxt->linenumbers = xmlLineNumbersDefaultValue;
|
ctxt->linenumbers = xmlLineNumbersDefaultValue;
|
||||||
ctxt->keepBlanks = xmlKeepBlanksDefaultValue;
|
ctxt->keepBlanks = xmlKeepBlanksDefaultValue;
|
||||||
if (ctxt->keepBlanks == 0)
|
if (ctxt->keepBlanks == 0)
|
||||||
sax->ignorableWhitespace = ignorableWhitespace;
|
ctxt->sax->ignorableWhitespace = ignorableWhitespace;
|
||||||
|
|
||||||
ctxt->vctxt.userData = ctxt;
|
ctxt->vctxt.userData = ctxt;
|
||||||
ctxt->vctxt.error = xmlParserValidityError;
|
ctxt->vctxt.error = xmlParserValidityError;
|
||||||
|
Reference in New Issue
Block a user