Invalid _BLOCK_TYPE_IS_VALID(pHead->nBlockUse) while deleting plot curve
-
I am using
Qt 5.3.2
qwt 6.1.2
Visual Studio 2012
Windows 7, x64The following code gives invalid _BLOCK_TYPE_IS_VALID(pHead->nBlockUse) while deleting the plot curve. Any idea?
QApplication *app=new QApplication(argc,argv); QwtPlot *window = new QwtPlot(); QwtPlotCurve *d_curve1 = new QwtPlotCurve( "Amplitude" ); d_curve1->setRenderHint( QwtPlotItem::RenderAntialiased ); d_curve1->setPen( Qt::yellow ); d_curve1->setLegendAttribute( QwtPlotCurve::LegendShowLine ); d_curve1->setYAxis( QwtPlot::yLeft ); d_curve1->setXAxis( QwtPlot::xBottom ); d_curve1->attach( window ); window->show(); app->exec(); delete window; // Assertion fails here window = NULL; delete app; app=NULL;
-
Hi and welcome to devnet,
There's a double deletion happening somewhere.
Do you have the same with:
QApplication app(argc,argv); QwtPlot window; QwtPlotCurve *d_curve1 = new QwtPlotCurve( "Amplitude" ); d_curve1->setRenderHint( QwtPlotItem::RenderAntialiased ); d_curve1->setPen( Qt::yellow ); d_curve1->setLegendAttribute( QwtPlotCurve::LegendShowLine ); d_curve1->setYAxis( QwtPlot::yLeft ); d_curve1->setXAxis( QwtPlot::xBottom ); d_curve1->attach( window ); window.show(); return app.exec();
-
Hi and welcome to devnet,
There's a double deletion happening somewhere.
Do you have the same with:
QApplication app(argc,argv); QwtPlot window; QwtPlotCurve *d_curve1 = new QwtPlotCurve( "Amplitude" ); d_curve1->setRenderHint( QwtPlotItem::RenderAntialiased ); d_curve1->setPen( Qt::yellow ); d_curve1->setLegendAttribute( QwtPlotCurve::LegendShowLine ); d_curve1->setYAxis( QwtPlot::yLeft ); d_curve1->setXAxis( QwtPlot::xBottom ); d_curve1->attach( window ); window.show(); return app.exec();
-
What if you detach the curve and delete it by hand ?