Changeset 489


Ignore:
Timestamp:
Apr 24, 2007 2:08:43 PM (12 years ago)
Author:
pbonami
Message:

Fixed two potential leaks

Location:
trunk/Bonmin/src/Algorithms
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Bonmin/src/Algorithms/BonBabSetupBase.cpp

    r483 r489  
    158158
    159159BabSetupBase::~BabSetupBase(){
    160   delete linearSolver_;
    161160  if(nonlinearSolver_ != linearSolver_)
    162161    delete nonlinearSolver_;
     162  delete linearSolver_;
    163163  delete branchingMethod_;
    164164  for(CuttingMethods::iterator i = cutGenerators_.begin() ; i != cutGenerators_.end() ; i++){
  • trunk/Bonmin/src/Algorithms/BonBonminSetup.cpp

    r481 r489  
    407407      cg.cgl = nlpsol;
    408408      cg.id="NLP solution based oa cuts";
     409      cutGenerators_.push_back(cg);
    409410    }
    410411   
  • trunk/Bonmin/src/Algorithms/BonBonminSetup.hpp

    r486 r489  
    2525    virtual BabSetupBase * clone() const {
    2626      return new BonminSetup(*this);}
    27 
     27    virtual ~BonminSetup(){}
    2828    /** @name Methods to instantiate: Registering and retrieving options and initializing everything. */
    2929    /** @{ */
  • trunk/Bonmin/src/Algorithms/OaGenerators/BonOaDecBase.cpp

    r481 r489  
    459459    const double * elements = mat->getElements();
    460460    const int * indices = mat->getIndices();
    461     for (int i = 0 ; i <= numcols_ ; i++)
     461    for (int i = 0 ; i < numcols_ ; i++)
    462462      for (int k = start[i] ; k < start[i] + length[i] ; k++)
    463463      {
     
    468468    si_->addRows(numberCutsToAdd, (const CoinPackedVectorBase * const *) addCuts, si.getRowLower() + numrows_,
    469469        si.getRowUpper() + numrows_);
     470    for(int i = 0 ; i < numberCutsToAdd ; i++){
     471      delete addCuts[i];
     472    }
     473    delete [] addCuts;
    470474  }
    471475  else if (numberCutsToAdd < 0)//Oups some error
Note: See TracChangeset for help on using the changeset viewer.