mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-27 11:49:01 +03:00
Merge pull request #11977 from Chocobo1/init
Fix singleton class ownership
This commit is contained in:
commit
8b330e3ac0
3 changed files with 5 additions and 9 deletions
|
@ -550,7 +550,7 @@ int Application::exec(const QStringList ¶ms)
|
|||
#ifndef DISABLE_COUNTRIES_RESOLUTION
|
||||
Net::GeoIPManager::initInstance();
|
||||
#endif
|
||||
ScanFoldersModel::initInstance(this);
|
||||
ScanFoldersModel::initInstance();
|
||||
|
||||
#ifndef DISABLE_WEBUI
|
||||
m_webui = new WebUI;
|
||||
|
|
|
@ -57,14 +57,10 @@ struct ScanFoldersModel::PathData
|
|||
|
||||
ScanFoldersModel *ScanFoldersModel::m_instance = nullptr;
|
||||
|
||||
bool ScanFoldersModel::initInstance(QObject *parent)
|
||||
void ScanFoldersModel::initInstance()
|
||||
{
|
||||
if (!m_instance) {
|
||||
m_instance = new ScanFoldersModel(parent);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
if (!m_instance)
|
||||
m_instance = new ScanFoldersModel;
|
||||
}
|
||||
|
||||
void ScanFoldersModel::freeInstance()
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
CUSTOM_LOCATION
|
||||
};
|
||||
|
||||
static bool initInstance(QObject *parent = nullptr);
|
||||
static void initInstance();
|
||||
static void freeInstance();
|
||||
static ScanFoldersModel *instance();
|
||||
|
||||
|
|
Loading…
Reference in a new issue