mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-26 00:37:43 +03:00
parser: Don't call *DefaultSAXHandlerInit from xmlInitParser
Change the default handler definitions to match the result after calling the initialization functions. This makes sure that no thread-local variables are accessed when calling xmlInitParser.
This commit is contained in:
12
SAX2.c
12
SAX2.c
@@ -2937,7 +2937,7 @@ xmlSAX2InitDefaultSAXHandler(xmlSAXHandler *hdlr, int warning)
|
|||||||
/**
|
/**
|
||||||
* xmlDefaultSAXHandlerInit:
|
* xmlDefaultSAXHandlerInit:
|
||||||
*
|
*
|
||||||
* DEPRECATED: This function will be made private. Call xmlInitParser to
|
* DEPRECATED: This function is a no-op. Call xmlInitParser to
|
||||||
* initialize the library.
|
* initialize the library.
|
||||||
*
|
*
|
||||||
* Initialize the default SAX2 handler
|
* Initialize the default SAX2 handler
|
||||||
@@ -2945,9 +2945,6 @@ xmlSAX2InitDefaultSAXHandler(xmlSAXHandler *hdlr, int warning)
|
|||||||
void
|
void
|
||||||
xmlDefaultSAXHandlerInit(void)
|
xmlDefaultSAXHandlerInit(void)
|
||||||
{
|
{
|
||||||
#ifdef LIBXML_SAX1_ENABLED
|
|
||||||
xmlSAXVersion((xmlSAXHandlerPtr) &xmlDefaultSAXHandler, 1);
|
|
||||||
#endif /* LIBXML_SAX1_ENABLED */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef LIBXML_HTML_ENABLED
|
#ifdef LIBXML_HTML_ENABLED
|
||||||
@@ -2998,17 +2995,12 @@ xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr)
|
|||||||
/**
|
/**
|
||||||
* htmlDefaultSAXHandlerInit:
|
* htmlDefaultSAXHandlerInit:
|
||||||
*
|
*
|
||||||
* DEPRECATED: This function will be made private. Call xmlInitParser to
|
* DEPRECATED: This function is a no-op. Call xmlInitParser to
|
||||||
* initialize the library.
|
* initialize the library.
|
||||||
*
|
|
||||||
* Initialize the default SAX handler
|
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
htmlDefaultSAXHandlerInit(void)
|
htmlDefaultSAXHandlerInit(void)
|
||||||
{
|
{
|
||||||
#ifdef LIBXML_SAX1_ENABLED
|
|
||||||
xmlSAX2InitHtmlDefaultSAXHandler((xmlSAXHandlerPtr) &htmlDefaultSAXHandler);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* LIBXML_HTML_ENABLED */
|
#endif /* LIBXML_HTML_ENABLED */
|
||||||
|
|||||||
@@ -427,7 +427,7 @@ xmlSAXHandlerV1 xmlDefaultSAXHandler = {
|
|||||||
xmlSAX2GetParameterEntity,
|
xmlSAX2GetParameterEntity,
|
||||||
xmlSAX2CDataBlock,
|
xmlSAX2CDataBlock,
|
||||||
xmlSAX2ExternalSubset,
|
xmlSAX2ExternalSubset,
|
||||||
0,
|
1,
|
||||||
};
|
};
|
||||||
#endif /* LIBXML_SAX1_ENABLED */
|
#endif /* LIBXML_SAX1_ENABLED */
|
||||||
|
|
||||||
@@ -480,10 +480,10 @@ xmlSAXHandlerV1 htmlDefaultSAXHandler = {
|
|||||||
xmlParserWarning,
|
xmlParserWarning,
|
||||||
xmlParserError,
|
xmlParserError,
|
||||||
xmlParserError,
|
xmlParserError,
|
||||||
xmlSAX2GetParameterEntity,
|
NULL,
|
||||||
xmlSAX2CDataBlock,
|
xmlSAX2CDataBlock,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
1,
|
||||||
};
|
};
|
||||||
#endif /* LIBXML_HTML_ENABLED */
|
#endif /* LIBXML_HTML_ENABLED */
|
||||||
|
|
||||||
|
|||||||
2
parser.c
2
parser.c
@@ -14498,14 +14498,12 @@ xmlInitParser(void) {
|
|||||||
xmlInitMemory();
|
xmlInitMemory();
|
||||||
xmlInitializeDict();
|
xmlInitializeDict();
|
||||||
xmlInitCharEncodingHandlers();
|
xmlInitCharEncodingHandlers();
|
||||||
xmlDefaultSAXHandlerInit();
|
|
||||||
xmlRegisterDefaultInputCallbacks();
|
xmlRegisterDefaultInputCallbacks();
|
||||||
#ifdef LIBXML_OUTPUT_ENABLED
|
#ifdef LIBXML_OUTPUT_ENABLED
|
||||||
xmlRegisterDefaultOutputCallbacks();
|
xmlRegisterDefaultOutputCallbacks();
|
||||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||||
#ifdef LIBXML_HTML_ENABLED
|
#ifdef LIBXML_HTML_ENABLED
|
||||||
htmlInitAutoClose();
|
htmlInitAutoClose();
|
||||||
htmlDefaultSAXHandlerInit();
|
|
||||||
#endif
|
#endif
|
||||||
#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
|
#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
|
||||||
xmlXPathInit();
|
xmlXPathInit();
|
||||||
|
|||||||
Reference in New Issue
Block a user