Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
3a424fc1
Commit
3a424fc1
authored
Oct 29, 2013
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ConnectSE: fixing memory leaks reported by valgrind
parent
7dc48ae3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
2 deletions
+41
-2
storage/connect/libdoc.cpp
storage/connect/libdoc.cpp
+41
-2
No files found.
storage/connect/libdoc.cpp
View file @
3a424fc1
...
...
@@ -8,6 +8,9 @@
#include <libxml/tree.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include <libxml/catalog.h>
#include <libxml/xmlschemastypes.h>
#include <libxml/relaxng.h>
//#if defined(WIN32)
//#include <windows.h>
//#else // !WIN32
...
...
@@ -290,10 +293,46 @@ if (!rc)
/******************************************************************/
/* XML library cleanup function. */
/******************************************************************/
/*
This is a copy of xmlCleanupParser() from the libxml2 sources
with xmlResetLastError() commented.
xmlResetLastError() called from the original xmlCleanupParser() causes
valgrind to report memory leaks. This happens because
ha_initialize_handlerton() is called from the main thread in mysqld.cc,
while ha_finalize_handlerton() is called from a non-main thread.
libxml2 gets confused because of xmlInitParser() and xmlCleanupParser()
being called from the different threads.
Perhaps the code in mysqld.cc should eventually be modified
to shutdown plugins from the main thread.
*/
static
void
xmlCleanupParser_replacement
(
void
)
{
xmlCleanupCharEncodingHandlers
();
#ifdef LIBXML_CATALOG_ENABLED
xmlCatalogCleanup
();
#endif
xmlDictCleanup
();
xmlCleanupInputCallbacks
();
#ifdef LIBXML_OUTPUT_ENABLED
xmlCleanupOutputCallbacks
();
#endif
#ifdef LIBXML_SCHEMAS_ENABLED
xmlSchemaCleanupTypes
();
xmlRelaxNGCleanupTypes
();
#endif
//xmlResetLastError();
xmlCleanupGlobals
();
xmlCleanupThreads
();
/* must be last if called not from the main thread */
xmlCleanupMemory
();
}
void
XmlCleanupParserLib
(
void
)
{
xmlCleanupParser
();
xmlMemoryDump
();
xmlCleanupParser_replacement
();
}
// end of XmlCleanupParserLib
/******************************************************************/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment