#172 QwtPlotCurve deletes QwtSymbol using "delete symbol"

closed
nobody
None
5
2012-08-23
2012-08-22
Anonymous
No

Hi,

Thanks for your library.

However there seems to be a bug in QwtPlotCurve in version libqwt 6. It executes 'delete symbol' internally for each symbol when the plot is destroyed. This is a problem when one has more than one symbol allocated together in a chunk (or through static memory), in which case each symbol must be allocated separately.

eg:

curve = new QwtPlotCurve*[maxN];
symbol = new QwtSymbol[maxN};
....
for(int i=0;i<maxN;i++){
curve[i]= new QwtPlotCurve();
....
curve[i]->setSymbol(symbol[i])
}

Thanks

Kedar

Discussion

  • Uwe Rathmann

    Uwe Rathmann - 2012-08-23

    Like for the parent of a QObject it is intended, that a curve takes ownership of the symbol. So don't allocate it as static memory and better don't pass the same symbol to different curves.

     
  • Uwe Rathmann

    Uwe Rathmann - 2012-08-23
    • status: open --> closed-rejected
     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks