Changeset 2378 for trunk/Cbc


Ignore:
Timestamp:
Aug 26, 2018 4:51:50 PM (11 months ago)
Author:
unxusr
Message:

additional checks for vector

File:
1 edited

Legend:

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

    r2372 r2378  
    74407440                                numberGenerators = babModel_->numberCutGenerators();
    74417441                                // can get here twice!
    7442                                 delete [] statistics_number_cuts;
    7443                                 delete [] statistics_name_generators;
    7444                                 statistics_number_cuts = new int [numberGenerators];;
     7442                                if (statistics_number_cuts!=NULL)
     7443                                    delete [] statistics_number_cuts;
     7444                                statistics_number_cuts = new int [numberGenerators];
     7445
     7446                                if (statistics_name_generators!=NULL)
     7447                                    delete [] statistics_name_generators;
     7448                                statistics_name_generators = new const char *[numberGenerators];
     7449
    74457450                                statistics_number_generators = numberGenerators;
    7446                                 statistics_name_generators = new const char *[numberGenerators];
     7451
    74477452                                char timing[30];
    74487453                                for (iGenerator = 0; iGenerator < numberGenerators; iGenerator++) {
     
    96349639                                    statistics_nprocessedrows, statistics_nprocessedcols);
    96359640                            for (int i = 0; i < statistics_number_generators; i++)
    9636                                 fprintf(fp, ",%d", statistics_number_cuts[i]);
     9641                                fprintf(fp, ",%d", statistics_number_cuts[i]!=NULL ? statistics_number_cuts[i] : 0);
    96379642                            fprintf(fp, ",");
    96389643                            for (int i = 1; i < argc; i++) {
     
    1047010475#endif
    1047110476    delete [] lotsize;
    10472     delete [] statistics_number_cuts;
    10473     delete [] statistics_name_generators;
     10477    if (statistics_number_cuts!=NULL)
     10478        delete [] statistics_number_cuts;
     10479
     10480    if (statistics_name_generators!=NULL)
     10481        delete [] statistics_name_generators;
    1047410482    // By now all memory should be freed
    1047510483#ifdef DMALLOC
Note: See TracChangeset for help on using the changeset viewer.