Store CDataCacheSerializer as a pointer for correct lifetime management

This commit is contained in:
Mat Sutcliffe
2020-03-28 22:04:14 +00:00
parent 0ee522426a
commit e8380173c9
2 changed files with 22 additions and 14 deletions

View File

@@ -250,6 +250,9 @@ namespace BlackMisc
Q_OBJECT
public:
//! Destructor.
virtual ~CDataCache() override;
//! Return the singleton instance.
static CDataCache *instance();
@@ -302,7 +305,7 @@ namespace BlackMisc
QFileSystemWatcher m_watcher;
CDataCacheSerializer m_serializer { this, revisionFileName() };
CDataCacheSerializer *m_serializer = nullptr;
CDataCacheRevision m_revision { persistentStore() + "/" };
friend class CDataCacheSerializer; // to access m_revision and protected members of CValueCache
};