Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Invalid _BLOCK_TYPE_IS_VALID(pHead->nBlockUse) while deleting plot curve

    3rd Party Software
    qwt nblockuse
    2
    4
    1658
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      virtual last edited by virtual

      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;
      
      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by SGaist

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

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        V 1 Reply Last reply Reply Quote 0
        • V
          virtual @SGaist last edited by

          @SGaist That was not helping

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

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

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply Reply Quote 0
            • First post
              Last post