Commit 5ee3d2da authored by Rafael Roquetto's avatar Rafael Roquetto Committed by Tobias Hunger

Fix BlackBerryConfigurationManager singleton

The usage of a static variable instead of a pointer guarantees it will be
constructed and destructed only once.

Change-Id: I7f587ec131b43fe5685122e9a384f1871dcdf790
Reviewed-by: default avatarMehdi Fekari <mfekari@blackberry.com>
Reviewed-by: default avatarDavid Kaspar <dkaspar@blackberry.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 834c8932
......@@ -447,10 +447,9 @@ void BlackBerryConfigurationManager::saveSettings()
BlackBerryConfigurationManager &BlackBerryConfigurationManager::instance()
{
if (m_instance == 0)
m_instance = new BlackBerryConfigurationManager();
static BlackBerryConfigurationManager instance;
return *m_instance;
return instance;
}
BlackBerryConfigurationManager::~BlackBerryConfigurationManager()
......@@ -483,7 +482,5 @@ QString BlackBerryConfigurationManager::defaultDebugTokenPath() const
return QnxUtils::dataDirPath() + QLatin1String("/debugtoken.bar");
}
BlackBerryConfigurationManager* BlackBerryConfigurationManager::m_instance = 0;
} // namespace Internal
} // namespace Qnx
......@@ -80,7 +80,6 @@ signals:
private:
BlackBerryConfigurationManager(QObject *parent = 0);
static BlackBerryConfigurationManager *m_instance;
QList<BlackBerryConfiguration*> m_configs;
BlackBerryConfiguration *m_defaultApiLevel;
......
......@@ -73,7 +73,6 @@ QNXPlugin::QNXPlugin()
QNXPlugin::~QNXPlugin()
{
delete BlackBerryDeviceConnectionManager::instance();
delete &BlackBerryConfigurationManager::instance();
}
bool QNXPlugin::initialize(const QStringList &arguments, QString *errorString)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment