diff --git a/src/app/valentina/core/vcmdexport.cpp b/src/app/valentina/core/vcmdexport.cpp index 82de220ef..0edcae108 100644 --- a/src/app/valentina/core/vcmdexport.cpp +++ b/src/app/valentina/core/vcmdexport.cpp @@ -294,6 +294,13 @@ VCommandLinePtr VCommandLine::Get(const QCoreApplication& app) return instance; } +//--------------------------------------------------------------------------------------------------------------------- +VCommandLine::~VCommandLine() +{ + qDeleteAll(optionsUsed.begin(), optionsUsed.end()); + optionsUsed.clear(); +} + //------------------------------------------------------------------------------------------------------ Q_NORETURN void VCommandLine::Error(const QString &text) const { diff --git a/src/app/valentina/core/vcmdexport.h b/src/app/valentina/core/vcmdexport.h index b69e0e9a5..11709316c 100644 --- a/src/app/valentina/core/vcmdexport.h +++ b/src/app/valentina/core/vcmdexport.h @@ -49,7 +49,7 @@ class VCommandLine private: static VCommandLinePtr instance; QCommandLineParser parser; - const QMap optionsUsed; + QMap optionsUsed; bool isGuiEnabled; friend class VApplication; @@ -77,9 +77,8 @@ protected: static VCommandLinePtr Get(const QCoreApplication& app); public: - VCommandLine(const VCommandLine&) = delete; - VCommandLine& operator =(const VCommandLine&) = delete; - virtual ~VCommandLine(){} + Q_DISABLE_COPY(VCommandLine) + virtual ~VCommandLine(); //@brief creates object and applies export related options to parser