Commit 6b355ed7 authored by Ken Edmundson's avatar Ken Edmundson
Browse files

Fixed cholmod memory leak in BundleAdjust.cpp; impacts application jigsaw; references #2189

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@6032 41f8697f-d340-4b68-9986-7bafba869bb8
parent e94a960e
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -1090,7 +1090,7 @@ namespace Isis {
      // check for convergence
      if ( !m_bDeltack ) {
        if (fabs(dSigma0_previous - m_dSigma0) <= m_dConvergenceThreshold) {
          //convergeance detected
          //convergence detected
          if (m_maxLikelihoodIndex+1 < 3 && m_maxLikelihoodFlag[m_maxLikelihoodIndex+1]) {  //if maximum likelihood tiers are being processed check to see if there's another tier to go //if there's another tier to go check the flag to see if it's enabled
            m_maxLikelihoodIndex++;  //if there's another tier to go then continue with the next maximum likelihood model
          }
@@ -1146,7 +1146,15 @@ namespace Isis {
      }

      // restart the dynamic calculation of the cumulative probility distribution of residuals (in unweighted pixels) --so it will be up to date for the next iteration
      if (!m_bConverged) m_cumProRes->initialize(101);
      if (!m_bConverged)
        m_cumProRes->initialize(101);

      // if we're still going, release cholmod_factor (if we don't, memory leaks will occur),
      // otherwise we need it for error propagation
      if (!m_bDeltack) {
        if (!m_bConverged || (m_bConverged && !m_bErrorPropagation))
          cholmod_free_factor(&m_L, &m_cm);
      }

      SpecialKIterationSummary();

+3 −0
Original line number Diff line number Diff line
@@ -165,6 +165,9 @@ namespace Isis {
   *                         the number of valid (Ignore= False) measures.
   *   @history 2014-02-25 Ken Edmundson - Speed up and memory improvements to error propagation.
   *                         References #2031.
   *   @history 2014-11-05 Ken Edmundson - Fixed memory bug. Wasn't releasing cholmod_factor m_L
   *                         every iteration. Now release every iteration but the last since we
   *                         need m_L for error propagation. References #2189.
   */
  class BundleAdjust {
    public: