Changeset 11611:8adbcea5b7b2 in orange


Ignore:
Timestamp:
07/01/13 16:27:34 (10 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Fixed a memory leak when raising an exception.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/orange/liblinear_interface.cpp

    r11610 r11611  
    389389 
    390390PClassifier TLinearLearner::operator()(PExampleGenerator examples, const int &weight){ 
     391    PDomain domain = examples->domain; 
     392 
     393    if (!domain->classVar) { 
     394        raiseError("classVar expected"); 
     395    } 
     396 
     397    if (domain->classVar->varType != TValue::INTVAR) { 
     398        raiseError("Discrete class expected"); 
     399    } 
     400 
    391401    parameter *param = new parameter; 
    392402    param->solver_type = solver_type; 
     
    396406    param->weight_label = NULL; 
    397407    param->weight = NULL; 
    398  
    399     PDomain domain = examples->domain; 
    400  
    401     if (!domain->classVar) 
    402         raiseError("classVar expected"); 
    403  
    404     if (domain->classVar->varType != TValue::INTVAR) 
    405         raiseError("Discrete class expected"); 
    406408 
    407409    // Shallow copy of examples. 
Note: See TracChangeset for help on using the changeset viewer.