Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Invalid _BLOCK_TYPE_IS_VALID(pHead->nBlockUse) while deleting plot curve
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved 3rd Party Software
qwtnblockuse
4 Posts 2 Posters 1.9k Views
  • 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 Offline
    V Offline
    virtual
    wrote on last edited by virtual
    #1

    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by SGaist
      #2

      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
      0
      • SGaistS 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();
        
        V Offline
        V Offline
        virtual
        wrote on last edited by
        #3

        @SGaist That was not helping

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved