|
17 | 17 | CStateVariable::CStateVariable() |
18 | 18 | { |
19 | 19 | this->Initialize(); |
| 20 | + _pTransportModel=NULL; |
20 | 21 | } |
21 | 22 |
|
22 | 23 | ////////////////////////////////////////////////////////////////// |
23 | 24 | /// \brief Initializes static arrays of CStateVariable class |
24 | 25 | // |
25 | 26 | void CStateVariable::Initialize() |
26 | 27 | { |
27 | | - this->_nAliases = 0; |
28 | | - this->_aAliases = NULL; |
29 | | - this->_aAliasReferences = NULL; |
| 28 | + _nAliases = 0; |
| 29 | + _aAliases = NULL; |
| 30 | + _aAliasReferences = NULL; |
30 | 31 | } |
31 | 32 |
|
32 | 33 | ////////////////////////////////////////////////////////////////// |
33 | 34 | /// Destructor |
34 | 35 | // |
35 | 36 | CStateVariable::~CStateVariable() |
36 | 37 | { |
37 | | - this->Destroy(); |
| 38 | + delete [] _aAliases; |
| 39 | + delete [] _aAliasReferences; |
38 | 40 | } |
39 | 41 |
|
40 | 42 | ////////////////////////////////////////////////////////////////// |
41 | 43 | /// \brief Delete references to static alias arrays |
42 | 44 | // |
43 | | -void CStateVariable::Destroy() |
44 | | -{ |
45 | | - delete [] _aAliases; |
46 | | - delete [] _aAliasReferences; |
47 | | -} |
| 45 | +void CStateVariable::Destroy(){} |
48 | 46 |
|
49 | 47 | ////////////////////////////////////////////////////////////////// |
50 | 48 | /// \brief Dynamically adds additional string, s, onto dynamic array of strings, pArr. Increments size of array by one |
@@ -398,7 +396,7 @@ sv_type CStateVariable::StringToSVType(const string s, int &layer_index,bool str |
398 | 396 |
|
399 | 397 | if ((typ==CONSTITUENT) && ((int)(tmp.find_first_of("|"))!=-1)) //only used if e.g., !Nitrogen|SOIL[1] (rather than CONSTITUENT[32] or !Nitrogen[32]) is used |
400 | 398 | { |
401 | | - layer_index = this->_pTransportModel->GetLayerIndexFromName2(tmp, layer_index); |
| 399 | + layer_index = _pTransportModel->GetLayerIndexFromName2(tmp, layer_index); |
402 | 400 | if (layer_index==DOESNT_EXIST){typ=UNRECOGNIZED_SVTYPE;} |
403 | 401 | } |
404 | 402 |
|
|
0 commit comments