Salome HOME
Compilation under Windows: add missing header
[modules/kernel.git] / src / Launcher / Launcher_XML_Persistence.cxx
index 4c2d5ce06a52b0dee6ec607ff350ea42584258b7..ff1c2bff1e3906411ecfa9d61b3cf5804d036d91 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -284,7 +284,7 @@ XML_Persistence::createJobFromXmlNode(xmlNodePtr job_node)
   }
   catch (const LauncherException & exc)
   {
-    new_job->decrRef();
+    delete new_job;
     string error = string("Invalid job \"") + job_name + "\": " + exc.msg;
     throw LauncherException(error);
   }
@@ -519,7 +519,7 @@ Job*
 XML_Persistence::createJobFromString(const std::string& jobDump)
 {
   xmlDocPtr doc;
-  doc = xmlReadMemory(jobDump.c_str(), jobDump.length(), "noname.xml", NULL, 0);
+  doc = xmlReadMemory(jobDump.c_str(), (int)jobDump.length(), "noname.xml", NULL, 0); //TODO: conversion from size_t to int, possible loss of data
   if (doc == NULL)
   {
     std::string error = "Error in xmlReadMemory in XML_Persistence::createJobFromString, could not parse string: " + jobDump;