Commit 7a7ccdd2 authored by Adam Goins's avatar Adam Goins
Browse files

Fixes updating references in selectLeftMeasure and selectRightMeasure to fix a...

Fixes updating references in selectLeftMeasure and selectRightMeasure to fix a segfault that was occuring
parent fc3715aa
Loading
Loading
Loading
Loading
+26 −30
Original line number Diff line number Diff line
@@ -803,18 +803,17 @@ namespace Isis {
    //  to m_editPoint, otherwise create copy.  It will not be saved to net until "Save Point"
    //  is selected
    if (controlPoint->Parent() == NULL) {

      m_editPoint = controlPoint;
      // New point in editor, so colorize all save buttons
      colorizeAllSaveButtons("red");
    }
    else {
      m_editPoint = new ControlPoint;
      *m_editPoint = *controlPoint;

      m_editPoint = controlPoint;
      // New point loaded, make sure all save button's text is default black color
      colorizeAllSaveButtons("black");
    }

    }
    loadPoint(serialNumber);
    loadTemplateFile(m_measureEditor->templateFileName());
  }
@@ -860,6 +859,7 @@ namespace Isis {

    //  Write pointId
    QString CPId = m_editPoint->GetId();

    QString ptId("Point ID:  ");
    ptId += (QString) CPId;
    m_ptIdValue->setText(ptId);
@@ -901,6 +901,7 @@ namespace Isis {
    else {
      rad = "Apriori Radius:  " + QString::number(surfPoint.GetLocalRadius().meters(), 'f', 2);
    }

    m_aprioriRadius->setText(rad);

    //  Set EditLock box correctly
@@ -1019,12 +1020,13 @@ namespace Isis {
        rightIndex = 0;
      }
    }

    //  Handle pts with a single measure, for now simply put measure on left/right
    //  Evenutally put on left with black on right??
    if (rightIndex > m_editPoint->GetNumMeasures()-1) rightIndex = 0;

    m_rightCombo->setCurrentIndex(rightIndex);
    m_leftCombo->setCurrentIndex(leftIndex);

    //  Initialize pointEditor with measures
    selectLeftMeasure(leftIndex);
    selectRightMeasure(rightIndex);
@@ -1968,7 +1970,6 @@ namespace Isis {
  void ControlPointEditWidget::selectLeftMeasure(int index) {

    QString file = m_pointFiles[index];

    QString serial;
    try {
      serial = m_serialNumberList->serialNumber(file);
@@ -1991,9 +1992,8 @@ namespace Isis {
      delete m_leftMeasure;
      m_leftMeasure = NULL;
    }
    m_leftMeasure = new ControlMeasure();
    //  Find measure for each file    
    *m_leftMeasure = *((*m_editPoint)[serial]);

    m_leftMeasure = ((*m_editPoint)[serial]);

    //  If m_leftCube is not null, delete before creating new one
    m_leftCube.reset(new Cube(file, "r"));
@@ -2001,7 +2001,6 @@ namespace Isis {
    //  Update left measure of pointEditor
    m_measureEditor->setLeftMeasure (m_leftMeasure, m_leftCube.data(), m_editPoint->GetId());
    updateLeftMeasureInfo ();

  }


@@ -2041,10 +2040,7 @@ namespace Isis {
      delete m_rightMeasure;
      m_rightMeasure = NULL;
    }
    m_rightMeasure = new ControlMeasure();

    //  Find measure for each file
    *m_rightMeasure = *((*m_editPoint)[serial]);
    m_rightMeasure = ((*m_editPoint)[serial]);

    //  If m_rightCube is not null, delete before creating new one
    m_rightCube.reset(new Cube(file, "r"));
+3 −1
Original line number Diff line number Diff line
@@ -90,6 +90,8 @@ namespace Isis {
   *                           Fixes #5399.
   *   @history 2018-05-02 Tracie Sucharski - Colorize save buttons properly when creating new
   *                           control point and loading a different control point.
   *   @history 2018-06-19 Adam Goins - Fixes updating references in selectLeftMeasure and
   *                           selectRightMeasure to fix a segfault that was occuring. #Fixes #5435
   */
  class ControlPointEditWidget : public QWidget {
    Q_OBJECT