From e3cfd7a241cd97739c3d11fb7b5cf72e3e7bf1c1 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 10 May 2018 13:46:50 +0300 Subject: [PATCH] Fix memory leak. --HG-- branch : develop --- src/libs/ifc/xml/vabstractpattern.cpp | 7 +++++++ src/libs/ifc/xml/vabstractpattern.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index b65ae28d6..7946bea94 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -249,6 +249,13 @@ VAbstractPattern::VAbstractPattern(QObject *parent) modified(false) {} +//--------------------------------------------------------------------------------------------------------------------- +VAbstractPattern::~VAbstractPattern() +{ + qDeleteAll(toolsOnRemove); + toolsOnRemove.clear(); +} + //--------------------------------------------------------------------------------------------------------------------- QStringList VAbstractPattern::ListMeasurements() const { diff --git a/src/libs/ifc/xml/vabstractpattern.h b/src/libs/ifc/xml/vabstractpattern.h index 24ad9e50d..8e154bdeb 100644 --- a/src/libs/ifc/xml/vabstractpattern.h +++ b/src/libs/ifc/xml/vabstractpattern.h @@ -84,7 +84,7 @@ class VAbstractPattern : public VDomDocument Q_OBJECT public: explicit VAbstractPattern(QObject *parent = nullptr); - virtual ~VAbstractPattern() Q_DECL_EQ_DEFAULT; + virtual ~VAbstractPattern(); QStringList ListMeasurements() const; QVector ListExpressions() const;