Changeset 433

Show
Ignore:
Timestamp:
08/25/09 13:20:37 (15 years ago)
Author:
bhilburn
Message:

Reworked memory allocation in the constructors a bit more. Looking at,
I'm not 100% certain how it wasn't segfaulting previously during normal
operation since 'LoadConfiguration?' was being called before the memory
was allocated.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • vtcross/trunk/src/shell/CognitiveRadioShell.cpp

    r432 r433  
    4949{ 
    5050    LOG("Creating Cognitive Radio Shell.\n"); 
     51 
    5152    SML_present = false; 
    5253    PE_present = false; 
    5354    CE_present = false; 
    5455 
    55     /* These allocations must be done here to prevent a segfault should the 
    56      * shell be constructed then immediately destructed. */ 
    5756    params = new Parameter[10]; 
    5857    observables = new Observable[10]; 
     
    7574{ 
    7675    LOG("Creating Cognitive Radio Shell.\n"); 
     76 
     77    SML_present = false; 
     78    PE_present = false; 
     79    CE_present = false; 
     80 
     81    params = new Parameter[10]; 
     82    observables = new Observable[10]; 
     83    utils = new Utility[10]; 
     84    radio_info = new Radio_Info; 
     85 
    7786    LoadRadioConfiguration(radioConfig, params, utils, observables, radio_info); 
    7887