Ignore:
Timestamp:
Nov 21, 2014 5:57:22 AM (5 years ago)
Author:
forrest
Message:

try and improve memory leaks (and clean up Clp pthread build problem)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcModel.cpp

    r2094 r2097  
    47884788        master_->stopThreads(-1);
    47894789        master_->waitForThreadsInTree(2);
    4790         delete master_;
    4791         master_ = NULL;
    4792         masterThread_ = NULL;
    47934790        // adjust time to allow for children on some systems
    47944791        //dblParam_[CbcStartSeconds] -= CoinCpuTimeJustChildren();
     
    48124809            double dummyBest;
    48134810            tree_->cleanTree(this, -COIN_DBL_MAX, dummyBest) ;
     4811#ifdef CBC_THREAD
     4812            if (parallelMode() > 0 && master_) {
     4813              // see if any dangling nodes
     4814              int numberThreads = master_->numberThreads();
     4815              for (int i=0;i<numberThreads;i++) {
     4816                CbcThread * child = master_->child(i);
     4817                //if (child->createdNode())
     4818                //printf("CHILD_NODE %p\n",child->createdNode());
     4819                delete child->createdNode();
     4820              }
     4821            }
     4822#endif
    48144823        }
    48154824        delete nextRowCut_;
     
    48504859        }
    48514860    }
     4861#ifdef CBC_THREAD
     4862    if (master_) {
     4863        delete master_;
     4864        master_ = NULL;
     4865        masterThread_ = NULL;
     4866    }
     4867#endif
    48524868    /*
    48534869      That's it, we've exhausted the search tree, or broken out of the loop because
     
    99249940    int firstOldCut = numberRowsAtContinuous_ ;
    99259941    int totalNumberCuts = numberNewCuts_ + numberOldActiveCuts_ ;
     9942    assert (numberRowsAtContinuous_+totalNumberCuts==
     9943            solver_->getNumRows());
    99269944    int *solverCutIndices = new int[totalNumberCuts] ;
    99279945    int *newCutIndices = new int[numberNewCuts_] ;
Note: See TracChangeset for help on using the changeset viewer.