Changeset 9178:08b35f657761 in orange


Ignore:
Timestamp:
11/07/11 17:09:13 (2 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
96387d0538644ba40239471a0b6de85358f70281
Message:

Fixed a memory leak (LRInput.trials did not get deleted), fixes #998.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/orange/logfit.cpp

    r6531 r9178  
    185185    for(int i = 0; i<=numExamples; i++) 
    186186      if (matrix[i]) 
    187         delete matrix[i]; 
    188       delete matrix; 
     187        delete[] matrix[i]; 
     188      delete[] matrix; 
    189189  } 
    190190 
     
    211211    } 
    212212    catch (...) { 
    213         delete Y; 
     213        delete[] Y; 
    214214    } 
    215215 
     
    236236    } 
    237237    catch (...) { 
    238         delete Y; 
     238        delete[] Y; 
    239239    } 
    240240 
     
    261261    } 
    262262    catch (...) { 
    263       delete T; 
     263      delete[] T; 
    264264      throw; 
    265265    } 
     
    278278    if (data != NULL) { 
    279279        for (i=0; i <= nn; ++i) 
    280             delete data[i]; 
    281         delete data; 
     280            delete[] data[i]; 
     281        delete[] data; 
    282282    } 
    283283    if (success != NULL) { 
    284         delete success; 
     284        delete[] success; 
     285    } 
     286    if (trials != NULL){ 
     287        delete[] trials; 
    285288    } 
    286289} 
     
    298301    if (cov_beta!=NULL) 
    299302        for (int i = 0; i <= k; ++i) 
    300             delete cov_beta[i]; 
    301     delete cov_beta; 
    302     delete fit; 
    303     delete beta; 
    304     delete se_beta; 
    305     delete stdres; 
    306     delete dependent; 
    307 } 
    308  
     303            delete[] cov_beta[i]; 
     304    delete[] cov_beta; 
     305    delete[] fit; 
     306    delete[] beta; 
     307    delete[] se_beta; 
     308    delete[] stdres; 
     309    delete[] dependent; 
     310} 
     311 
Note: See TracChangeset for help on using the changeset viewer.