QwtPolar 1.0.0 examples crash when exiting
Hi there,
I've just compiled latest QwtPolar (1.0.0) with Qwt 6.0.1 and Qt 4.7.4 on windows using VC9. The two examples crashes when the application ends. It crashes in the function:
QwtLegend::remove
Anyone coming across this issue ? Does anyone has an idea to get around this problem.
Thanks,
Jean-Charles
Re: QwtPolar 1.0.0 examples crash when exiting
Start your debugger and show the call stack,
Uwe
Re: QwtPolar 1.0.0 examples crash when exiting
From polardemo:
> qwtd.dll!QwtLegend::remove(const QwtLegendItemManager * plotItem=0x00ac11d0) Ligne 384 + 0x7 octets C++
qwtpolard.dll!QwtPolarItem::attach(QwtPolarPlot * plot=0x00000000) Ligne 83 C++
qwtpolard.dll!QwtPolarItemDict::detachItems(int rtti=0, bool autoDelete=true) Ligne 151 C++
qwtpolard.dll!QwtPolarItemDict::~QwtPolarItemDict( ) Ligne 86 C++
qwtpolard.dll!QwtPolarPlot::~QwtPolarPlot() Ligne 104 + 0xf octets C++
polardemo.exe!Plot::~Plot() + 0x10 octets C++
polardemo.exe!Plot::`scalar deleting destructor'() + 0xf octets C++
QtCored4.dll!QObjectPrivate::deleteChildren() Ligne 1936 + 0x24 octets C++
QtGuid4.dll!QWidget::~QWidget() Ligne 1634 C++
polardemo.exe!QWidget::`scalar deleting destructor'() + 0x10 octets C++
QtCored4.dll!QObjectPrivate::deleteChildren() Ligne 1936 + 0x24 octets C++
QtGuid4.dll!QWidget::~QWidget() Ligne 1634 C++
QtGuid4.dll!QMainWindow::~QMainWindow() Ligne 370 + 0x22 octets C++
polardemo.exe!MainWindow::~MainWindow() + 0x10 octets C++
polardemo.exe!main(int argc=1, char * * argv=0x00a07820) Ligne 12 + 0x15 octets C++
polardemo.exe!WinMain(HINSTANCE__ * instance=0x00400000, HINSTANCE__ * prevInstance=0x00000000, char * __formal=0x00151f23, int cmdShow=1) Ligne 132 + 0x12 octets C++
polardemo.exe!__tmainCRTStartup() Ligne 578 + 0x35 octets C
polardemo.exe!WinMainCRTStartup() Ligne 403 C
and spectrogram:
> qwtd.dll!QwtLegend::remove(const QwtLegendItemManager * plotItem=0x00ac18f8) Ligne 384 + 0x7 octets C++
qwtpolard.dll!QwtPolarItem::attach(QwtPolarPlot * plot=0x00000000) Ligne 83 C++
qwtpolard.dll!QwtPolarItemDict::detachItems(int rtti=0, bool autoDelete=true) Ligne 151 C++
qwtpolard.dll!QwtPolarItemDict::~QwtPolarItemDict( ) Ligne 86 C++
qwtpolard.dll!QwtPolarPlot::~QwtPolarPlot() Ligne 104 + 0xf octets C++
spectrogram.exe!Plot::~Plot() + 0x10 octets C++
spectrogram.exe!Plot::`scalar deleting destructor'() + 0xf octets C++
QtCored4.dll!QObjectPrivate::deleteChildren() Ligne 1936 + 0x24 octets C++
QtGuid4.dll!QWidget::~QWidget() Ligne 1634 C++
spectrogram.exe!PlotWindow::~PlotWindow() + 0x10 octets C++
spectrogram.exe!PlotWindow::`scalar deleting destructor'() + 0xf octets C++
QtCored4.dll!QObjectPrivate::deleteChildren() Ligne 1936 + 0x24 octets C++
QtGuid4.dll!QWidget::~QWidget() Ligne 1634 C++
QtGuid4.dll!QMainWindow::~QMainWindow() Ligne 370 + 0x22 octets C++
spectrogram.exe!MainWindow::~MainWindow() + 0x10 octets C++
spectrogram.exe!main(int argc=1, char * * argv=0x00a07820) Ligne 67 + 0x15 octets C++
spectrogram.exe!WinMain(HINSTANCE__ * instance=0x00400000, HINSTANCE__ * prevInstance=0x00000000, char * __formal=0x00151f25, int cmdShow=1) Ligne 132 + 0x12 octets C++
spectrogram.exe!__tmainCRTStartup() Ligne 578 + 0x35 octets C
spectrogram.exe!WinMainCRTStartup() Ligne 403 C
It seems the same issue.
Re: QwtPolar 1.0.0 examples crash when exiting
Well, the crash doesn't happen on my linux box, but my guess is, that the legend is already destructed when the plot items are going to be removed.
I have added the following line to the destructor of QwtPolarPlot:
Code:
QwtPolarPlot::~QwtPolarPlot()
{
detachItems( QwtPolarItem::Rtti_PolarItem, autoDelete() );
...
}
Please do the same and let me know if the crash is gone.
Uwe
Re: QwtPolar 1.0.0 examples crash when exiting
Hi Uwe,
I've just tried with this additional line and it doesn't crash any more, well done !
Thanks a lot for your help.
Cheers,
Jean-Charles