From 3f331cd3546e96951bdf8aefb95dfa13a1d95431 Mon Sep 17 00:00:00 2001 From: LM Date: Wed, 28 Dec 2011 16:30:13 +0100 Subject: [PATCH] Temporarily fixed application closedown crash, needs further work to become clean --- qgroundcontrol.pri | 4 ++++ src/ui/linechart/LinechartPlot.cc | 24 +++++++++++++++++++++++- src/ui/linechart/LinechartWidget.cc | 2 ++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/qgroundcontrol.pri b/qgroundcontrol.pri index a2b8db18b..e725637aa 100644 --- a/qgroundcontrol.pri +++ b/qgroundcontrol.pri @@ -131,6 +131,8 @@ macx|macx-g++42|macx-g++: { # GNU/Linux linux-g++ { + CONFIG -= console + debug { #DESTDIR = $$TARGETDIR/debug #CONFIG += debug console @@ -215,6 +217,8 @@ message("Compiling for linux 32") linux-g++-64 { + CONFIG -= console + debug { #DESTDIR = $$TARGETDIR/debug #CONFIG += debug console diff --git a/src/ui/linechart/LinechartPlot.cc b/src/ui/linechart/LinechartPlot.cc index c8c6aee69..337d4657f 100644 --- a/src/ui/linechart/LinechartPlot.cc +++ b/src/ui/linechart/LinechartPlot.cc @@ -132,7 +132,29 @@ LinechartPlot::LinechartPlot(QWidget *parent, int plotid, quint64 interval): Qwt LinechartPlot::~LinechartPlot() { - removeAllData(); +// datalock.lock(); +// // Delete curves +// QMap::iterator i; +// for(i = curves.begin(); i != curves.end(); ++i) { +// // Remove from curve list +// QwtPlotCurve* curve = curves.take(i.key()); +// // Delete the object +// delete curve; +// // Set the pointer null +// curve = NULL; +// } + +// // Delete data +// QMap::iterator j; +// for(j = data.begin(); j != data.end(); ++j) { +// // Remove from data list +// TimeSeriesData* d = data.take(j.key()); +// // Delete the object +// delete d; +// // Set the pointer null +// d = NULL; +// } +// datalock.unlock(); } void LinechartPlot::showEvent(QShowEvent* event) diff --git a/src/ui/linechart/LinechartWidget.cc b/src/ui/linechart/LinechartWidget.cc index 88b3fd6c8..d580cb33e 100644 --- a/src/ui/linechart/LinechartWidget.cc +++ b/src/ui/linechart/LinechartWidget.cc @@ -153,6 +153,8 @@ LinechartWidget::~LinechartWidget() { writeSettings(); stopLogging(); + if (activePlot) delete activePlot; + activePlot = NULL; delete listedCurves; listedCurves = NULL; } -- 2.22.0