Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Potentials/PartialNucleiChargeFitter.cpp

    rf60d95 r6b3e5e  
    227227PartialNucleiChargeFitter::~PartialNucleiChargeFitter()
    228228{
    229   delete PotentialFromCharges;
     229  if (PartialCharges != NULL)
     230    delete PartialCharges;
     231
     232  if (PotentialFromCharges != NULL)
     233    delete PotentialFromCharges;
    230234}
    231235
     
    235239  const size_t rows = SampledPotential.getDimension();
    236240  const size_t cols = positions.size();
     241
     242  // allocate memory for PotentialFromCharges
     243  if (PotentialFromCharges != NULL) {
     244    delete PotentialFromCharges;
     245    PotentialFromCharges = NULL;
     246  }
    237247  PotentialFromCharges = new MatrixContent( rows, cols );
    238248  // store step length per axis
     
    285295{
    286296  // prepare PartialCharges
     297  if (PartialCharges != NULL) {
     298    delete PartialCharges;
     299    PartialCharges = NULL;
     300  }
    287301  PartialCharges = new VectorContent(positions.size());
    288302
Note: See TracChangeset for help on using the changeset viewer.