From: ribes Date: Thu, 5 May 2011 16:29:10 +0000 (+0000) Subject: Remove job from batch manager only when call deleteJob X-Git-Tag: V6_3_0b1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bd7a6b1b4a80df5b2107a17b503c79fdc0121442;p=modules%2Fkernel.git Remove job from batch manager only when call deleteJob --- diff --git a/src/Launcher/Launcher.cxx b/src/Launcher/Launcher.cxx index e416a934c..c4ef5180c 100644 --- a/src/Launcher/Launcher.cxx +++ b/src/Launcher/Launcher.cxx @@ -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); } diff --git a/src/Launcher/Launcher_Job.cxx b/src/Launcher/Launcher_Job.cxx index 9e32e8742..c9250cb65 100644 --- a/src/Launcher/Launcher_Job.cxx +++ b/src/Launcher/Launcher_Job.cxx @@ -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 } diff --git a/src/Launcher/Launcher_Job.hxx b/src/Launcher/Launcher_Job.hxx index eeba823a7..10db9897e 100644 --- a/src/Launcher/Launcher_Job.hxx +++ b/src/Launcher/Launcher_Job.hxx @@ -109,6 +109,8 @@ namespace Launcher // Xml method void addToXmlDocument(xmlNodePtr root_node); + void removeJob(); + // Abstract class virtual void update_job() = 0;