From f2f583797d1723b443bf370ec5b7b133ad83b9fa Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 21 Aug 2016 22:27:54 +0200 Subject: spline-widget: disconnect "recomputed" in dtor In case mem is still used elsewhere we still have a use-after-free otherwise. --- spline-widget/spline-widget.cpp | 6 ++++++ spline-widget/spline-widget.hpp | 1 + 2 files changed, 7 insertions(+) (limited to 'spline-widget') diff --git a/spline-widget/spline-widget.cpp b/spline-widget/spline-widget.cpp index 54107bbe..6e3a95b3 100644 --- a/spline-widget/spline-widget.cpp +++ b/spline-widget/spline-widget.cpp @@ -29,6 +29,12 @@ spline_widget::spline_widget(QWidget *parent) : setMouseTracking(true); } +spline_widget::~spline_widget() +{ + if (connection) + QObject::disconnect(connection); +} + void spline_widget::setConfig(spline* spl) { if (spl != _config) diff --git a/spline-widget/spline-widget.hpp b/spline-widget/spline-widget.hpp index 5fc50504..80397ac7 100644 --- a/spline-widget/spline-widget.hpp +++ b/spline-widget/spline-widget.hpp @@ -31,6 +31,7 @@ class OPENTRACK_SPLINE_EXPORT spline_widget final : public QWidget using points_t = spline::points_t; public: spline_widget(QWidget *parent = 0); + ~spline_widget(); spline* config(); -- cgit v1.2.3