+ use XMLString::release to free memory

This commit is contained in:
wmayer 2014-07-16 19:11:17 +02:00
parent b316991220
commit a5c8529b53

View File

@ -1053,9 +1053,9 @@ void ParameterManager::Init(void)
#endif #endif
char *pMsg = XMLString::transcode(toCatch.getMessage()); char *pMsg = XMLString::transcode(toCatch.getMessage());
err << "Error during Xerces-c Initialization.\n" err << "Error during Xerces-c Initialization.\n"
<< " Exception message:" << " Exception message:"
<< pMsg; << pMsg;
delete [] pMsg; XMLString::release(&pMsg);
throw Exception(err.str().c_str()); throw Exception(err.str().c_str());
} }
Init = true; Init = true;
@ -1441,7 +1441,7 @@ bool DOMPrintErrorHandler::handleError(const DOMError &domError)
// Display whatever error message passed from the serializer // Display whatever error message passed from the serializer
char *msg = XMLString::transcode(domError.getMessage()); char *msg = XMLString::transcode(domError.getMessage());
std::cout<<msg<<std::endl; std::cout<<msg<<std::endl;
delete[] msg; XMLString::release(&msg);
// Instructs the serializer to continue serialization if possible. // Instructs the serializer to continue serialization if possible.
return true; return true;