summary refs log tree commit diff
path: root/src/Cache.cc
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-05-11 13:41:46 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-05-11 13:41:46 +0300
commit05585ff8cf9ef090c7158af47d99df835a22686d (patch)
tree6599b9b5674bb780e174667a9b9dee079f5a4b30 /src/Cache.cc
parentAdd scrollbar in the settings menu (diff)
downloadnheko-05585ff8cf9ef090c7158af47d99df835a22686d.tar.xz
Make explicit that MatrixClient & Cache are unique pointers
Diffstat (limited to 'src/Cache.cc')
-rw-r--r--src/Cache.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Cache.cc b/src/Cache.cc

index d80834aa..23d37f58 100644 --- a/src/Cache.cc +++ b/src/Cache.cc
@@ -54,21 +54,21 @@ using CachedReceipts = std::multimap<uint64_t, std::string, std::greater<uint64_ using Receipts = std::map<std::string, std::map<std::string, uint64_t>>; namespace { -Cache *instance_ = nullptr; +std::unique_ptr<Cache> instance_ = nullptr; } namespace cache { void -init(const QString &user_id, QObject *parent) +init(const QString &user_id) { if (!instance_) - instance_ = new Cache(user_id, parent); + instance_ = std::make_unique<Cache>(user_id); } Cache * client() { - return instance_; + return instance_.get(); } }