]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/xml/xmlpars.cpp
fixed memory leak in wxZlibInputStream
[wxWidgets.git] / contrib / src / xml / xmlpars.cpp
index 978dab5fb1f3d0adcea6d35c3726765e21f8a790..ba56cb3c1325dacc983844036d3ef262687dd668 100644 (file)
@@ -121,7 +121,10 @@ static void ReleaseLibxml()
 {
     if (gs_libxmlLoaded)
     {
-        gs_libxmlDLL.xmlCleanupParser();
+        // Check for CleanupParser ..may have failed before initialised 
+        // during LOAD_SYMBOL in LoadLibxml()
+        if (gs_libxmlDLL.xmlCleanupParser) 
+            gs_libxmlDLL.xmlCleanupParser();
         wxDllLoader::UnloadLibrary(gs_libxmlDLL.Handle);
     }
     gs_libxmlLoaded = FALSE;
@@ -139,15 +142,15 @@ static bool LoadLibxml()
     wxLogNull lg;
 #ifdef __UNIX__
     gs_libxmlDLL.Handle = 
-        wxDllLoader::LoadLibrary(_T("wxlibxml.so.2"), &gs_libxmlLoaded);
+        wxDllLoader::LoadLibrary(wxT("wxlibxml.so.2"), &gs_libxmlLoaded);
     if (!gs_libxmlLoaded) gs_libxmlDLL.Handle = 
-        wxDllLoader::LoadLibrary(_T("libxml.so.2"), &gs_libxmlLoaded);
+        wxDllLoader::LoadLibrary(wxT("libxml.so.2"), &gs_libxmlLoaded);
 #endif
 #ifdef __WXMSW__
     gs_libxmlDLL.Handle = 
-        wxDllLoader::LoadLibrary(_T("wxlibxml2.dll"), &gs_libxmlLoaded);
+        wxDllLoader::LoadLibrary(wxT("wxlibxml2.dll"), &gs_libxmlLoaded);
     if (!gs_libxmlLoaded) gs_libxmlDLL.Handle = 
-        wxDllLoader::LoadLibrary(_T("libxml2.dll"), &gs_libxmlLoaded);
+        wxDllLoader::LoadLibrary(wxT("libxml2.dll"), &gs_libxmlLoaded);
 #endif
     }
     
@@ -159,7 +162,7 @@ static bool LoadLibxml()
     
 #define LOAD_SYMBOL(sym) \
     gs_libxmlDLL.sym = \
-        (type_##sym)wxDllLoader::GetSymbol(gs_libxmlDLL.Handle, _T(#sym)); \
+        (type_##sym)wxDllLoader::GetSymbol(gs_libxmlDLL.Handle, wxT(#sym)); \
     if (!gs_libxmlDLL.sym) \
     { \
         ReleaseLibxml(); \