Changeset 432
- Timestamp:
- 08/25/09 13:15:46 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
vtcross/trunk/src/shell/CognitiveRadioShell.cpp
r420 r432 53 53 CE_present = false; 54 54 55 // TODO =BUG= The params, observables, and utils arrays are not being 56 // allocated here. If an shell object is constructed, and then immediately 57 // destructed, there will be no allocated memory, and the delete operater 58 // will receive a null pointer, which will segfault. 59 } 60 61 62 CognitiveRadioShell::~CognitiveRadioShell() 63 { 64 delete [] params; 65 delete [] observables; 66 delete [] utils; 67 } 68 69 70 CognitiveRadioShell::CognitiveRadioShell(const char* radioConfig, int16_t p1, \ 71 int16_t p2, int16_t p3) 72 { 73 LOG("Creating Cognitive Radio Shell.\n"); 74 55 /* These allocations must be done here to prevent a segfault should the 56 * shell be constructed then immediately destructed. */ 75 57 params = new Parameter[10]; 76 58 observables = new Observable[10]; 77 59 utils = new Utility[10]; 78 60 radio_info = new Radio_Info; 79 61 } 62 63 64 CognitiveRadioShell::~CognitiveRadioShell() 65 { 66 delete [] params; 67 delete [] observables; 68 delete [] utils; 69 delete Radio_Info; 70 } 71 72 73 CognitiveRadioShell::CognitiveRadioShell(const char* radioConfig, int16_t p1, \ 74 int16_t p2, int16_t p3) 75 { 76 LOG("Creating Cognitive Radio Shell.\n"); 80 77 LoadRadioConfiguration(radioConfig, params, utils, observables, radio_info); 81 78 … … 652 649 653 650 654 int 651 int32_t 655 652 CognitiveRadioShell::HandleMessage(int32_t socketFD) 656 653 {