Fix memory leaks.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-09-22 16:30:06 +03:00
parent 2107a2205a
commit c01bc165db
2 changed files with 10 additions and 4 deletions

View File

@ -294,6 +294,13 @@ VCommandLinePtr VCommandLine::Get(const QCoreApplication& app)
return instance; return instance;
} }
//---------------------------------------------------------------------------------------------------------------------
VCommandLine::~VCommandLine()
{
qDeleteAll(optionsUsed.begin(), optionsUsed.end());
optionsUsed.clear();
}
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
Q_NORETURN void VCommandLine::Error(const QString &text) const Q_NORETURN void VCommandLine::Error(const QString &text) const
{ {

View File

@ -49,7 +49,7 @@ class VCommandLine
private: private:
static VCommandLinePtr instance; static VCommandLinePtr instance;
QCommandLineParser parser; QCommandLineParser parser;
const QMap<QString, QCommandLineOption *> optionsUsed; QMap<QString, QCommandLineOption *> optionsUsed;
bool isGuiEnabled; bool isGuiEnabled;
friend class VApplication; friend class VApplication;
@ -77,9 +77,8 @@ protected:
static VCommandLinePtr Get(const QCoreApplication& app); static VCommandLinePtr Get(const QCoreApplication& app);
public: public:
VCommandLine(const VCommandLine&) = delete; Q_DISABLE_COPY(VCommandLine)
VCommandLine& operator =(const VCommandLine&) = delete; virtual ~VCommandLine();
virtual ~VCommandLine(){}
//@brief creates object and applies export related options to parser //@brief creates object and applies export related options to parser