Changeset 14061


Ignore:
Timestamp:
06/04/12 16:06:27 (12 years ago)
Author:
ogrimm
Message:
Corrected bug in Evidenc/GUI.cc running over allowed index range in vector
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/Evidence/GUI.cc

    r12942 r14061  
    370370    }
    371371  } 
    372  
     372
    373373  // Generate new curve and subscribe to service
    374374  struct ItemDetails N;
     
    383383  legend()->remove(N.Curve);
    384384  legend()->insert(N.Curve, (QWidget *) Legend);
    385  
     385
    386386  // Context menu might delete curve and legend -> seg fault if using direct connection, as legend item deleted
    387387  connect(Legend, SIGNAL(DeleteCurve(QwtPlotCurve *)), this, SLOT(RemoveService(QwtPlotCurve *)), Qt::QueuedConnection);
     
    391391
    392392  for (int i=0; i<Hist.DataText.size(); i++) {
    393         AddPoint(List.size()-1, Hist.DataText[i].first, Hist.DataText[i].second.at(N.Index).toFloat());
     393    if (Hist.DataText[i].second.size() > N.Index) {
     394          AddPoint(List.size()-1, Hist.DataText[i].first, Hist.DataText[i].second.at(N.Index).toFloat());
     395        }
    394396  }
    395397
Note: See TracChangeset for help on using the changeset viewer.