crash in destructor of vector<QwtPlotCurve *>
Brought to you by:
rathmann
From: Matthias P. <mat...@gm...> - 2009-05-26 21:05:50
|
This is the trackback: QLaserDynamicd.exe!std::_Vector_val<QwtPlotCurve *,std::allocator<QwtPlotCurve *> >::~_Vector_val<QwtPlotCurve *,std::allocator<QwtPlotCurve *> >() + 0x21 bytes C++ > QLaserDynamicd.exe!std::vector<QwtPlotCurve *,std::allocator<QwtPlotCurve *> >::~vector<QwtPlotCurve *,std::allocator<QwtPlotCurve *> >() Line 547 + 0xf bytes C++ QLaserDynamicd.exe!QCurvePlot::~QCurvePlot() Line 38 + 0x62 bytes C++ QLaserDynamicd.exe!QCurvePlot::`scalar deleting destructor'() + 0x16 bytes C++ I have not the slightest idea why. I disabled all code I have written in the last two hours, but I still get these crashes. It would be very great if someone has an idea, because with this state I cannot continou to work! This is the header: class QCurvePlot : public QwtPlot { Q_OBJECT public: QCurvePlot(QWidget* parent = 0, Qt::WFlags flags = 0); virtual ~QCurvePlot(); public: vector<QwtPlotCurve*> Curve; QwtLegend legend; QwtLinearScaleEngine * ylinearScaleEngine; QwtLog10ScaleEngine * ylogScaleEngine; Zoomer * zoomer; QwtSymbol symbol; struct structDataXY{ structDataXY() : x(0), y(0) {} double * x; double * y; }; private: void initZoomer(); void initWidget(); void clear(); vector<structDataXY> data; QString description; public: void setDescription(QString str) { description = str; } void addCurve(); void setData(const unsigned int number, vector<double> & xData, vector<double> & yData, int start, int size); void setData(const unsigned int number, vector<double> & xData, vector<double> & yData); void setData(const unsigned int number, const double * xData, const double * yData, int size); void setData(const unsigned int number, const double * xData, const double * yData, int start, int size); void insertLegend(QwtPlot::LegendPosition legendPosition); void copyProperties(QCurvePlot * plot); }; and this the constructor and destructor: QCurvePlot::QCurvePlot(QWidget* parent /*= 0*/, Qt::WFlags flags /*= 0*/) //: QWidget(parent, flags) : QwtPlot(parent) , zoomer(new Zoomer(this)) , ylinearScaleEngine(new QwtLinearScaleEngine()) , ylogScaleEngine(new QwtLog10ScaleEngine()) { QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); sizePolicy.setHorizontalStretch(20); sizePolicy.setVerticalStretch(20); this->setSizePolicy(sizePolicy); initWidget(); } QCurvePlot::~QCurvePlot() { for (int i = 0; i < (int)data.size(); i++) { delete [] data[i].x; delete [] data[i].y; delete Curve[i]; } delete zoomer; delete ylinearScaleEngine; delete ylogScaleEngine; qDebug() << description; } |