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, x64

    The 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;
    

  • Lifetime Qt Champion

    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();
    


  • @SGaist That was not helping


  • Lifetime Qt Champion

    What if you detach the curve and delete it by hand ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.