diff options
author | Tom Rondeau | 2010-05-02 15:00:02 -0400 |
---|---|---|
committer | Tom Rondeau | 2010-05-02 15:00:02 -0400 |
commit | 7488244b24a52e6b1a51bcbdb0077e70554c6731 (patch) | |
tree | 79b9c649fbc472ff0c08b0a498a740c06ef729ea | |
parent | e0df16cf6f62dd0745530955481df8c3eecc9cb2 (diff) | |
download | gnuradio-7488244b24a52e6b1a51bcbdb0077e70554c6731.tar.gz gnuradio-7488244b24a52e6b1a51bcbdb0077e70554c6731.tar.bz2 gnuradio-7488244b24a52e6b1a51bcbdb0077e70554c6731.zip |
Fixes segfault on close. Using the right objective (d_main_gui) instead of d_object to delete all of the plotting widgets. As far as Valgrind tells me, this cleans up my memory leaks although libqt and libqwt still have some of their own.
This checkin also disables the Waterfall3D plotting. It wasn't working anyway, but was also causing its own segfault upon deletion. Once it's working and deleting nicely, it will be re-enabled.
-rw-r--r-- | gr-qtgui/src/lib/WaterfallDisplayPlot.cc | 1 | ||||
-rw-r--r-- | gr-qtgui/src/lib/qtgui_sink_c.cc | 2 | ||||
-rw-r--r-- | gr-qtgui/src/lib/qtgui_sink_f.cc | 2 | ||||
-rw-r--r-- | gr-qtgui/src/lib/spectrumdisplayform.cc | 30 |
4 files changed, 27 insertions, 8 deletions
diff --git a/gr-qtgui/src/lib/WaterfallDisplayPlot.cc b/gr-qtgui/src/lib/WaterfallDisplayPlot.cc index f53d3181c..298eaffe9 100644 --- a/gr-qtgui/src/lib/WaterfallDisplayPlot.cc +++ b/gr-qtgui/src/lib/WaterfallDisplayPlot.cc @@ -289,6 +289,7 @@ WaterfallDisplayPlot::WaterfallDisplayPlot(QWidget* parent) WaterfallDisplayPlot::~WaterfallDisplayPlot() { delete _waterfallData; + delete d_spectrogram; } void diff --git a/gr-qtgui/src/lib/qtgui_sink_c.cc b/gr-qtgui/src/lib/qtgui_sink_c.cc index fefa98704..a148cf501 100644 --- a/gr-qtgui/src/lib/qtgui_sink_c.cc +++ b/gr-qtgui/src/lib/qtgui_sink_c.cc @@ -88,7 +88,7 @@ qtgui_sink_c::qtgui_sink_c (int fftsize, int wintype, qtgui_sink_c::~qtgui_sink_c() { - delete d_object; + delete d_main_gui; delete [] d_residbuf; delete d_fft; } diff --git a/gr-qtgui/src/lib/qtgui_sink_f.cc b/gr-qtgui/src/lib/qtgui_sink_f.cc index 563a77d69..8eb0a0347 100644 --- a/gr-qtgui/src/lib/qtgui_sink_f.cc +++ b/gr-qtgui/src/lib/qtgui_sink_f.cc @@ -88,7 +88,7 @@ qtgui_sink_f::qtgui_sink_f (int fftsize, int wintype, qtgui_sink_f::~qtgui_sink_f() { - delete d_object; + delete d_main_gui; delete [] d_residbuf; delete d_fft; } diff --git a/gr-qtgui/src/lib/spectrumdisplayform.cc b/gr-qtgui/src/lib/spectrumdisplayform.cc index 9e7609a77..d7c593e2f 100644 --- a/gr-qtgui/src/lib/spectrumdisplayform.cc +++ b/gr-qtgui/src/lib/spectrumdisplayform.cc @@ -18,7 +18,7 @@ SpectrumDisplayForm::SpectrumDisplayForm(bool useOpenGL, QWidget* parent) _waterfallDisplayPlot = new WaterfallDisplayPlot(WaterfallPlotDisplayFrame); if((QGLFormat::hasOpenGL()) && (_useOpenGL)) { - _waterfall3DDisplayPlot = new Waterfall3DDisplayPlot(Waterfall3DPlotDisplayFrame); + //_waterfall3DDisplayPlot = new Waterfall3DDisplayPlot(Waterfall3DPlotDisplayFrame); } _timeDomainDisplayPlot = new TimeDomainDisplayPlot(TimeDomainDisplayFrame); @@ -82,7 +82,7 @@ SpectrumDisplayForm::~SpectrumDisplayForm() // Qt deletes children when parent is deleted // Don't worry about deleting Display Plots - they are deleted when parents are deleted - /* delete _intValidator; */ + delete _intValidator; delete[] _realFFTDataPoints; delete[] _averagedValues; @@ -93,6 +93,7 @@ SpectrumDisplayForm::~SpectrumDisplayForm() delete _historyVector; + displayTimer->stop(); delete displayTimer; } @@ -233,9 +234,11 @@ SpectrumDisplayForm::newFrequencyData( const SpectrumUpdateEvent* spectrumUpdate } if((QGLFormat::hasOpenGL()) && (_useOpenGL)) { if( _openGLWaterfall3DFlag == 1 && (tabindex == d_plot_waterfall3d)) { + /* _waterfall3DDisplayPlot->PlotNewData(_realFFTDataPoints, numFFTDataPoints, d_update_time, dataTimestamp, spectrumUpdateEvent->getDroppedFFTFrames()); + */ } } } @@ -268,7 +271,7 @@ SpectrumDisplayForm::resizeEvent( QResizeEvent *e ) if((QGLFormat::hasOpenGL()) && (_useOpenGL)) { s.setWidth(Waterfall3DPlotDisplayFrame->width()); s.setHeight(Waterfall3DPlotDisplayFrame->height()); - emit _waterfall3DDisplayPlot->resizeSlot(&s); + //emit _waterfall3DDisplayPlot->resizeSlot(&s); } s.setWidth(ConstellationDisplayFrame->width()); @@ -295,6 +298,7 @@ SpectrumDisplayForm::customEvent( QEvent * e) waterfall3DMaximumIntensityChangedCB(Waterfall3DMaximumIntensityWheel->value()); // Check for Hardware Acceleration of the OpenGL + /* if(!_waterfall3DDisplayPlot->format().directRendering()){ // Only ask this once while the program is running... if(_openGLWaterfall3DFlag == -1){ @@ -307,6 +311,7 @@ SpectrumDisplayForm::customEvent( QEvent * e) else{ _openGLWaterfall3DFlag = 1; } + */ } if(_openGLWaterfall3DFlag != 1){ @@ -436,11 +441,13 @@ SpectrumDisplayForm::SetFrequencyRange(const double newCenterFrequency, UseRFFrequenciesCheckBox->isChecked(), units, strunits[iunit]); if((QGLFormat::hasOpenGL()) && (_useOpenGL)) { + /* _waterfall3DDisplayPlot->SetFrequencyRange(_startFrequency, _stopFrequency, _centerFrequency, UseRFFrequenciesCheckBox->isChecked(), units, strunits[iunit]); + */ } _timeDomainDisplayPlot->SetSampleRate(_stopFrequency - _startFrequency, units, strtime[iunit]); @@ -533,7 +540,7 @@ SpectrumDisplayForm::Reset() _waterfallDisplayPlot->Reset(); if((QGLFormat::hasOpenGL()) && (_useOpenGL)) { - _waterfall3DDisplayPlot->Reset(); + //_waterfall3DDisplayPlot->Reset(); } } @@ -619,9 +626,11 @@ SpectrumDisplayForm::waterfall3DMaximumIntensityChangedCB( double newValue ) else{ Waterfall3DMaximumIntensityWheel->setValue(Waterfall3DMinimumIntensityWheel->value()); } - + + /* _waterfall3DDisplayPlot->SetIntensityRange(Waterfall3DMinimumIntensityWheel->value(), Waterfall3DMaximumIntensityWheel->value()); + */ } } @@ -636,9 +645,11 @@ SpectrumDisplayForm::waterfall3DMinimumIntensityChangedCB( double newValue ) else{ Waterfall3DMinimumIntensityWheel->setValue(Waterfall3DMaximumIntensityWheel->value()); } - + + /* _waterfall3DDisplayPlot->SetIntensityRange(Waterfall3DMinimumIntensityWheel->value(), Waterfall3DMaximumIntensityWheel->value()); + */ } } @@ -735,8 +746,10 @@ SpectrumDisplayForm::Waterfall3DIntensityColorTypeChanged( int newType ) QMessageBox::information(this, "High Intensity Color Selection", "In the next window, select the high intensity color for the waterfall display", QMessageBox::Ok); highIntensityColor = QColorDialog::getColor(highIntensityColor, this); } + /* _waterfall3DDisplayPlot->SetIntensityColorMapType(newType, lowIntensityColor, highIntensityColor); + */ } } @@ -775,12 +788,17 @@ void SpectrumDisplayForm::ToggleTabWaterfall3D(const bool state) { if(state == true) { + /* if((QGLFormat::hasOpenGL()) && (_useOpenGL)) { if(d_plot_waterfall3d == -1) { SpectrumTypeTab->addTab(Waterfall3DPage, "3D Waterfall Display"); d_plot_waterfall3d = SpectrumTypeTab->count()-1; } } + */ + SpectrumTypeTab->removeTab(SpectrumTypeTab->indexOf(Waterfall3DPage)); + d_plot_waterfall3d = -1; + fprintf(stderr, "\nWARNING: The Waterfall3D plot has been disabled until we get it working.\n\n"); } else { SpectrumTypeTab->removeTab(SpectrumTypeTab->indexOf(Waterfall3DPage)); |