diff --git a/eo/src/mpi/eoMpi.h b/eo/src/mpi/eoMpi.h index 8521d5c30..c277ddd07 100644 --- a/eo/src/mpi/eoMpi.h +++ b/eo/src/mpi/eoMpi.h @@ -119,6 +119,7 @@ namespace eo template< typename JobData > struct JobStore { + // TODO commentaire: ces pointeurs devraient être alloués avec new pour éviter segfault on quit. JobStore( SendTaskFunction* stf, HandleResponseFunction* hrf, @@ -135,6 +136,16 @@ namespace eo // empty } + ~JobStore() + { + // TODO commentaire: Composition Pattern => délégation de la destruction => destruction homogène => new + // et delete partout. + delete _stf; + delete _hrf; + delete _ptf; + delete _iff; + } + SendTaskFunction & sendTask() { return *_stf; } HandleResponseFunction & handleResponse() { return *_hrf; } ProcessTaskFunction & processTask() { return *_ptf; } @@ -377,7 +388,7 @@ namespace eo AssignmentAlgorithm& assignmentAlgo; int masterRank; - const int workerStopCondition; + const int workerStopCondition; // TODO commentaire: message signifiant l'arrêt pour un worker bmpi::communicator& comm; SendTaskFunction & sendTask; diff --git a/eo/src/mpi/eoParallelApply.h b/eo/src/mpi/eoParallelApply.h index 4ef588303..d93b5b818 100644 --- a/eo/src/mpi/eoParallelApply.h +++ b/eo/src/mpi/eoParallelApply.h @@ -194,10 +194,6 @@ namespace eo virtual ~ParallelApplyStore() { - delete _stf; - delete _hrf; - delete _ptf; - delete _iff; } protected: diff --git a/eo/src/mpi/eoTerminateJob.h b/eo/src/mpi/eoTerminateJob.h index bda085a02..4dc9f421b 100644 --- a/eo/src/mpi/eoTerminateJob.h +++ b/eo/src/mpi/eoTerminateJob.h @@ -54,14 +54,6 @@ namespace eo _iff = new DummyIsFinishedFunction; } - ~DummyJobStore() - { - delete _stf; - delete _hrf; - delete _ptf; - delete _iff; - } - void* data() { return 0; } }; @@ -83,38 +75,6 @@ namespace eo } } }; - - /* - class TerminateJob : public Job - { - public: - TerminateJob( AssignmentAlgorithm& algo, int _ ) - : Job( algo, _ ) - { - // empty - } - - void sendTask( int wrkRank ) - { - // empty - } - - void handleResponse( int wrkRank ) - { - // empty - } - - void processTask( ) - { - // empty - } - - bool isFinished() - { - return true; - } - }; - */ } }