Changeset 213

Show
Ignore:
Timestamp:
03/26/09 13:23:40 (15 years ago)
Author:
bhilburn
Message:

Making field names more descriptive and easier to read. Also, added a
bug not about a possible segfault.

Location:
vtcross/trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • vtcross/trunk/src/include/vtcross/components.h

    r212 r213  
    340340        int16_t commandPort; 
    341341 
    342         Utility * u; 
    343         Parameter * p; 
    344         Observable * o; 
    345         struct Radio_Info * radio_info; 
     342        Utility *utils; 
     343        Parameter *params; 
     344        Observable *observables; 
     345        struct Radio_Info *radio_info; 
    346346}; 
    347347 
  • vtcross/trunk/src/shell/CognitiveRadioShell.cpp

    r212 r213  
    4242    PE_present = false; 
    4343    CE_present = false; 
     44 
     45    // TODO =BUG= The params, observables, and utils arrays are not being 
     46    // allocated here. If an shell object is constructed, and then immediately 
     47    // destructed, there will be no allocated memory, and the delete operater 
     48    // will receive a null pointer, which will segfault. 
    4449} 
    4550 
     
    4752CognitiveRadioShell::~CognitiveRadioShell() 
    4853{ 
    49     delete [] p; 
    50     delete [] o; 
    51     delete [] u; 
     54    delete [] params; 
     55    delete [] observables; 
     56    delete [] utils; 
    5257} 
    5358 
     
    5863    LOG("Creating Cognitive Radio Shell.\n"); 
    5964 
    60     p = new Parameter[10]; 
    61     o = new Observable[10]; 
    62     u = new Utility[10]; 
     65    params = new Parameter[10]; 
     66    observables = new Observable[10]; 
     67    utils = new Utility[10]; 
    6368    radio_info = new Radio_Info; 
    6469 
    65     LoadRadioConfiguration(radioConfig, p, u, o, radio_info); 
     70    LoadRadioConfiguration(radioConfig, params, utils, observables, radio_info); 
    6671 
    6772    primaryPort = p1;