Fix color @usernames sometimes not working at all (#3170)

Definitely memory fuckery involved - The comment from @lubieerror https://github.com/Chatterino/chatterino2/issues/2822#issuecomment-897252673 is finally what led me to adding tests and hopefully fixing this.
This commit is contained in:
pajlada
2021-08-21 12:38:38 +02:00
committed by GitHub
parent 07454d0537
commit d7fd08b1d6
6 changed files with 128 additions and 1 deletions
+2
View File
@@ -35,6 +35,7 @@ public:
lru_cache(lru_cache<key_t, value_t> &&other)
: _cache_items_list(std::move(other._cache_items_list))
, _cache_items_map(std::move(other._cache_items_map))
, _max_size(other._max_size)
{
other._cache_items_list.clear();
other._cache_items_map.clear();
@@ -44,6 +45,7 @@ public:
{
_cache_items_list = std::move(other._cache_items_list);
_cache_items_map = std::move(other._cache_items_map);
_max_size = other._max_size;
other._cache_items_list.clear();
other._cache_items_map.clear();
return *this;