Message ID | 20190314151012.905-8-ykaradzhov@vmware.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | Various modifications and fixes toward KS 1.0 | expand |
diff --git a/kernel-shark/src/KsGLWidget.cpp b/kernel-shark/src/KsGLWidget.cpp index 7a050c2..a2fcb8a 100644 --- a/kernel-shark/src/KsGLWidget.cpp +++ b/kernel-shark/src/KsGLWidget.cpp @@ -40,6 +40,12 @@ KsGLWidget::KsGLWidget(QWidget *parent) connect(&_model, SIGNAL(modelReset()), this, SLOT(update())); } +KsGLWidget::~KsGLWidget() +{ + for (auto &g: _graphs) + delete g; +} + /** Reimplemented function used to set up all required OpenGL resources. */ void KsGLWidget::initializeGL() { diff --git a/kernel-shark/src/KsGLWidget.hpp b/kernel-shark/src/KsGLWidget.hpp index 95f307b..3bcecf9 100644 --- a/kernel-shark/src/KsGLWidget.hpp +++ b/kernel-shark/src/KsGLWidget.hpp @@ -31,6 +31,8 @@ class KsGLWidget : public QOpenGLWidget public: explicit KsGLWidget(QWidget *parent = NULL); + ~KsGLWidget(); + void initializeGL() override; void resizeGL(int w, int h) override;
Not sure how I missed to define this destructor before. The good thing is that the GUI has only one GL widget, and this widget stays alive for the whole duration of the program. Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com> --- kernel-shark/src/KsGLWidget.cpp | 6 ++++++ kernel-shark/src/KsGLWidget.hpp | 2 ++ 2 files changed, 8 insertions(+)