]> SALOME platform Git repositories - modules/kernel.git/blobdiff - src/Launcher/TestLauncher.cxx
Salome HOME
Compilation under Windows: add missing header
[modules/kernel.git] / src / Launcher / TestLauncher.cxx
old mode 100755 (executable)
new mode 100644 (file)
index fe7655c..cdfd3b1
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #include "Launcher.hxx"
 #include <iostream>
 #include <string>
+#include <memory>
 
-int main(int argc, char** argv)
+int main()
 {
   std::string xmlfile("");
 
   try {
     Launcher_cpp *lcpp = new Launcher_cpp();
-    ResourcesManager_cpp *rcpp = new ResourcesManager_cpp();
+    std::shared_ptr<ResourcesManager_cpp> rcpp(new ResourcesManager_cpp());
     lcpp->SetResourcesManager(rcpp);
     if(!getenv("KERNEL_ROOT_DIR"))
       throw ResourcesException("you must define KERNEL_ROOT_DIR environment variable!! -> cannot load testLauncher.xml");
@@ -37,7 +38,6 @@ int main(int argc, char** argv)
     long jobid = lcpp->createJobWithFile(xmlfile.c_str(),"localhost");
     lcpp->launchJob(jobid);
     delete lcpp;
-    delete rcpp;
     std::cout << "test OK" << std::endl;
   } catch ( const ResourcesException &ex) {
     std::cout << ex.msg.c_str() << std::endl;