summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2018-04-02 22:58:54 +0200
committerPetr Mrázek <peterix@gmail.com>2018-04-02 22:58:54 +0200
commit4530d9064be088702c6bf971cb2c08f110d6f047 (patch)
treefb0a68b83bba691ffd2d1e3eb3e207aa78258a28 /api
parent3406335cd8044b38c9805a8d39bb2839b63ea22b (diff)
downloadMultiMC-4530d9064be088702c6bf971cb2c08f110d6f047.tar
MultiMC-4530d9064be088702c6bf971cb2c08f110d6f047.tar.gz
MultiMC-4530d9064be088702c6bf971cb2c08f110d6f047.tar.lz
MultiMC-4530d9064be088702c6bf971cb2c08f110d6f047.tar.xz
MultiMC-4530d9064be088702c6bf971cb2c08f110d6f047.zip
NOISSUE fix latent bugs in RWStorage
Diffstat (limited to 'api')
-rw-r--r--api/logic/RWStorage.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/api/logic/RWStorage.h b/api/logic/RWStorage.h
index b1598ca4..bbe8ac5a 100644
--- a/api/logic/RWStorage.h
+++ b/api/logic/RWStorage.h
@@ -42,7 +42,7 @@ public:
}
void setStale(K key)
{
- QReadLocker l(&lock);
+ QWriteLocker l(&lock);
if(cache.contains(key))
{
stale_entries.insert(key);
@@ -52,9 +52,10 @@ public:
{
QWriteLocker l(&lock);
cache.clear();
+ stale_entries.clear();
}
private:
QReadWriteLock lock;
QMap<K, V> cache;
QSet<K> stale_entries;
-}; \ No newline at end of file
+};