diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-21 22:27:54 +0200 | 
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-23 00:05:15 +0200 | 
| commit | f2f583797d1723b443bf370ec5b7b133ad83b9fa (patch) | |
| tree | 123932aa37383cb43307894610c6cd82f0ef3f46 | |
| parent | 321501ad58dad2688bde42992b61adcda5a313e0 (diff) | |
spline-widget: disconnect "recomputed" in dtor
In case mem<settings> is still used elsewhere we still have a use-after-free
otherwise.
| -rw-r--r-- | spline-widget/spline-widget.cpp | 6 | ||||
| -rw-r--r-- | spline-widget/spline-widget.hpp | 1 | 
2 files changed, 7 insertions, 0 deletions
| 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(); | 
