Fix singleton class ownership

We shouldn't allow Qt parent ownership in here.
This commit is contained in:
Chocobo1
2020-02-07 15:19:23 +08:00
committed by sledgehammer999
parent 0cd4900e92
commit 2289bf4005
3 changed files with 5 additions and 9 deletions

View File

@@ -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()

View File

@@ -65,7 +65,7 @@ public:
CUSTOM_LOCATION
};
static bool initInstance(QObject *parent = nullptr);
static void initInstance();
static void freeInstance();
static ScanFoldersModel *instance();