Ignore:
Timestamp:
Nov 5, 2009, 6:14:08 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
fc420f
Parents:
543ce4
Message:

LEAKFIX: ReturnFullMatrixForSymmetric() and InverseMatrix() have Malloc()s, in code was delete(), not Free()

  • valgrind showed the "mismatch free/delete" and is fixed. (mostly concerned functions in molecule_geometry.cpp and analysis_correlation.cpp)
  • LEAKFIX: logger and errorLogger instances were not free'd, this is done.

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/molecule_geometry.cpp

    r543ce4 r4ef101  
    3333  ActOnAllVectors( &Vector::WrapPeriodically, (const double *)M, (const double *)Minv);
    3434
    35   delete(M);
    36   delete(Minv);
     35  Free(&M);
     36  Free(&Minv);
    3737  delete(Center);
    3838  return status;
     
    5252  ActOnAllVectors( &Vector::WrapPeriodically, (const double *)M, (const double *)Minv);
    5353
    54   delete(M);
    55   delete(Minv);
     54  Free(&M);
     55  Free(&Minv);
    5656  return status;
    5757};
     
    233233  ActOnAllVectors( &Vector::WrapPeriodically, (const double *)M, (const double *)Minv);
    234234
    235   delete(M);
    236   delete(Minv);
     235  Free(&M);
     236  Free(&Minv);
    237237};
    238238
     
    253253  atom *Walker = start;
    254254  double *matrix = ReturnFullMatrixforSymmetric(cell_size);
     255  double *inversematrix = InverseMatrix(cell_size);
    255256  double tmp;
    256257  bool flag;
     
    266267#endif
    267268        Testvector.CopyVector(&Walker->x);
    268         Testvector.InverseMatrixMultiplication(matrix);
     269        Testvector.MatrixMultiplication(inversematrix);
    269270        Translationvector.Zero();
    270271        for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) {
     
    293294          if ((*Runner)->GetOtherAtom(Walker)->type->Z == 1) {
    294295            Testvector.CopyVector(&(*Runner)->GetOtherAtom(Walker)->x);
    295             Testvector.InverseMatrixMultiplication(matrix);
     296            Testvector.MatrixMultiplication(inversematrix);
    296297            Testvector.AddVector(&Translationvector);
    297298            Testvector.MatrixMultiplication(matrix);
     
    307308  } while (!flag);
    308309  Free(&matrix);
     310  Free(&inversematrix);
     311
    309312  Center.Scale(1./(double)AtomCount);
    310313};
Note: See TracChangeset for help on using the changeset viewer.