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;
}
//---------------------------------------------------------------------------------------------------------------------
VCommandLine::~VCommandLine()
{
qDeleteAll(optionsUsed.begin(), optionsUsed.end());
optionsUsed.clear();
}
//------------------------------------------------------------------------------------------------------
Q_NORETURN void VCommandLine::Error(const QString &text) const
{

View file

@ -49,7 +49,7 @@ class VCommandLine
private:
static VCommandLinePtr instance;
QCommandLineParser parser;
const QMap<QString, QCommandLineOption *> optionsUsed;
QMap<QString, QCommandLineOption *> 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