some pointers deleted equalled to null

This commit is contained in:
Dhanya Maliakal
2015-03-05 15:30:21 +01:00
parent 848569b216
commit 71ad7ae2f0
2 changed files with 12 additions and 11 deletions

View File

@ -197,7 +197,7 @@ void qTabActions::SetupWidgetWindow(){
//load positions
if(lblName[NumPositions]->isEnabled()){
//delete existing positions
if (positions) delete [] positions;
if (positions) {delete [] positions; positions = NULL;}
//get number of positions
int numPos=myDet->getPositions();
comboPos->setMaxCount(numPos);
@ -404,7 +404,7 @@ void qTabActions::SetPosition(){
}
//delete existing positions
if (positions) delete [] positions;
if (positions) {delete [] positions; positions = NULL;}
positions=new double[comboPos->count()];
//copying the list
for(int i=0;i<comboPos->count();i++)
@ -483,7 +483,7 @@ void qTabActions::Refresh(){
if(lblName[NumPositions]->isEnabled()){
//delete existing positions
if (positions) delete [] positions;
if (positions) {delete [] positions; positions = NULL;}
//get number of positions
int numPos=myDet->getPositions();
comboPos->setMaxCount(numPos);