]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Remove job from batch manager only when call deleteJob
authorribes <ribes>
Thu, 5 May 2011 16:29:10 +0000 (16:29 +0000)
committerribes <ribes>
Thu, 5 May 2011 16:29:10 +0000 (16:29 +0000)
src/Launcher/Launcher.cxx
src/Launcher/Launcher_Job.cxx
src/Launcher/Launcher_Job.hxx

index e416a934c26b2adfe7bd9808619417faa99b2bbf..c4ef5180c3f78be1eaaf63cc1cf8a5b340360fd6 100644 (file)
@@ -324,6 +324,7 @@ Launcher_cpp::removeJob(int job_id)
     throw LauncherException("Cannot find the job, is it created ?");
   }
 
+  it_job->second->removeJob();
   delete it_job->second;
   _launcher_job_map.erase(it_job);
 }
index 9e32e874225ebbc1404beedd0dbebdd111c83667..c9250cb65222fe4261c3274dc9e74c407bed6933 100644 (file)
@@ -61,6 +61,16 @@ Launcher::Job::Job()
 Launcher::Job::~Job() 
 {
   LAUNCHER_MESSAGE("Deleting job number: " << _number);
+#ifdef WITH_LIBBATCH
+  if (_batch_job)
+    delete _batch_job;
+#endif
+}
+
+void
+Launcher::Job::removeJob()
+{
+  LAUNCHER_MESSAGE("Removing job number: " << _number);
 #ifdef WITH_LIBBATCH
   if (_batch_job_id.getReference() != "undefined")
   {
@@ -70,11 +80,9 @@ Launcher::Job::~Job()
     }
     catch (const Batch::EmulationException &ex)
     {
-      LAUNCHER_INFOS("WARNING: exception when deleting the job: " << ex.message);
+      LAUNCHER_INFOS("WARNING: exception when removing the job: " << ex.message);
     }
   }
-  if (_batch_job)
-    delete _batch_job;
 #endif
 }
 
index eeba823a743d65c9d3fc3c05f72ccd657662a2bf..10db9897e1974aac7dd70fa22ba490009e66b715 100644 (file)
@@ -109,6 +109,8 @@ namespace Launcher
       // Xml method
       void addToXmlDocument(xmlNodePtr root_node);
 
+      void removeJob();
+
       // Abstract class
       virtual void update_job() = 0;