Skip to content

Commit

Permalink
Fix handling of xml init and terminate
Browse files Browse the repository at this point in the history
Signed-off-by: romanodanilo <[email protected]>
  • Loading branch information
romanodanilo committed Jun 11, 2024
1 parent be08f1e commit 6f41759
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/common/src/config_format/c_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cConfiguration::~cConfiguration()

bool cConfiguration::ParseFromXML(cConfiguration *config, const std::string &configFilePath)
{
XMLPlatformUtils::Initialize();
// XMLPlatformUtils::Initialize();
if (!CheckIfFileExists(configFilePath))
return false;

Expand Down Expand Up @@ -71,7 +71,7 @@ bool cConfiguration::ParseFromXML(cConfiguration *config, const std::string &con

delete pDomParser;

XMLPlatformUtils::Terminate();
// XMLPlatformUtils::Terminate();

return true;
}
Expand All @@ -88,7 +88,7 @@ cConfiguration *cConfiguration::ParseFromXML(const std::string &configFilePath)

void cConfiguration::WriteConfigurationToFile(const std::string &filePath)
{
XMLPlatformUtils::Initialize();
// XMLPlatformUtils::Initialize();
DOMImplementation *p_DOMImplementationCore =
DOMImplementationRegistry::getDOMImplementation(XMLString::transcode("core"));
DOMLSSerializer *p_DOMSerializer = ((DOMImplementationLS *)p_DOMImplementationCore)->createLSSerializer();
Expand Down Expand Up @@ -131,7 +131,7 @@ void cConfiguration::WriteConfigurationToFile(const std::string &filePath)
theOutput->release();
p_DOMSerializer->release();

XMLPlatformUtils::Terminate();
// XMLPlatformUtils::Terminate();
}

void cConfiguration::ProcessDomNode(DOMNode *const nodeToProcess, cConfiguration *const cConfig) const
Expand Down
4 changes: 0 additions & 4 deletions src/common/src/result_format/c_result_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ void cResultContainer::Clear()

void cResultContainer::WriteResults(const std::string &path) const
{
XMLPlatformUtils::Initialize();
DOMImplementation *p_DOMImplementationCore = DOMImplementationRegistry::getDOMImplementation(CONST_XMLCH("core"));

// For storing a file, we need DOMImplementationLS
Expand Down Expand Up @@ -97,7 +96,6 @@ void cResultContainer::WriteResults(const std::string &path) const
p_DOMSerializer->release();

XMLString::release(&pPath);
XMLPlatformUtils::Terminate();
}

/*
Expand All @@ -118,7 +116,6 @@ void cResultContainer::AddResultsFromXML(const std::string &strXmlFilePath)
}
else
{
XMLPlatformUtils::Initialize();
xercesc::XercesDOMParser *pDomParser = new xercesc::XercesDOMParser();

pDomParser->setValidationScheme(XercesDOMParser::Val_Never);
Expand Down Expand Up @@ -165,7 +162,6 @@ void cResultContainer::AddResultsFromXML(const std::string &strXmlFilePath)
}

delete pDomParser;
// XMLPlatformUtils::Terminate();
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/result_pooling/src/result_pooling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ int main(int argc, char *argv[])
}

RunResultPooling(inputParams, resultsDirectory);

return 0;
}

Expand All @@ -93,6 +92,7 @@ void ShowHelp(const std::string &toolPath)

void RunResultPooling(const cParameterContainer &inputParams, const fs::path &resultsDirectory)
{
XMLPlatformUtils::Initialize();
std::string strResultFile = inputParams.GetParam("strResultFile");

pResultContainer = new cResultContainer();
Expand Down Expand Up @@ -140,6 +140,7 @@ void RunResultPooling(const cParameterContainer &inputParams, const fs::path &re
std::cout << "Finished." << std::endl;

delete pResultContainer;
XMLPlatformUtils::Terminate();
}

static void AddFileLocationsToIssues()
Expand Down

0 comments on commit 6f41759

Please sign in to comment.