Changeset edb454 for src/Actions


Ignore:
Timestamp:
Jul 2, 2010, 11:29:56 AM (14 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
cd8e55
Parents:
bdc91e
Message:

MEMFIX: correlationmap was not free'd correctly in AnalysisPairCorrelationAction.

  • correlationmap pointer was instantiated before the ifs and inside, hence after them the wrong pointer (containing NULL) was free'd.
  • surfacemap (type == S) was not free'd at all.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/AnalysisAction/PairCorrelationAction.cpp

    rbdc91e redb454  
    8181    output.open(outputname.c_str());
    8282    binoutput.open(binoutputname.c_str());
    83     PairCorrelationMap *correlationmap = NULL;
    8483    if (type == "E") {
    8584      PairCorrelationMap *correlationmap = NULL;
     
    8887      else
    8988        correlationmap = PairCorrelation(World::getInstance().getMolecules(), elements);
    90       //OutputCorrelationToSurface(&output, correlationmap);
     89      OutputPairCorrelation(&output, correlationmap);
    9190      binmap = BinData( correlationmap, BinWidth, BinStart, BinEnd );
     91      OutputCorrelation ( &binoutput, binmap );
     92      delete(binmap);
     93      delete(correlationmap);
    9294    } else if (type == "P")  {
    9395      cout << "Point to correlate to is  " << Point << endl;
     
    9799      else
    98100        correlationmap = CorrelationToPoint(molecules, elements, &Point);
    99       //OutputCorrelationToSurface(&output, correlationmap);
     101      OutputCorrelationToPoint(&output, correlationmap);
    100102      binmap = BinData( correlationmap, BinWidth, BinStart, BinEnd );
     103      OutputCorrelation ( &binoutput, binmap );
     104      delete(binmap);
     105      delete(correlationmap);
    101106    } else if (type == "S") {
    102107      ASSERT(Boundary != NULL, "No molecule specified for SurfaceCorrelation.");
     
    105110      if (BinEnd > 0) {
    106111        if (BinEnd > 2.*radius)
    107             LCWidth = BinEnd;
     112          LCWidth = BinEnd;
    108113        else
    109114          LCWidth = 2.*radius;
     
    137142      }
    138143      binmap = BinData( surfacemap, BinWidth, BinStart, BinEnd );
    139     } else
     144      OutputCorrelation ( &binoutput, binmap );
     145      delete(binmap);
     146      delete(surfacemap);
     147    } else {
    140148      return Action::failure;
    141     OutputCorrelation ( &binoutput, binmap );
     149    }
    142150    output.close();
    143151    binoutput.close();
    144     delete(binmap);
    145     delete(correlationmap);
    146152    delete dialog;
    147153    return Action::success;
Note: See TracChangeset for help on using the changeset viewer.