summaryrefslogtreecommitdiff
path: root/include/utils
diff options
context:
space:
mode:
authorSergio Giro <sgiro@google.com>2015-11-17 11:52:05 +0000
committerSergio Giro <sgiro@google.com>2015-11-20 14:54:51 +0000
commitb7170fe3fe0d8933de57968222bab95ef6615a5a (patch)
treee1fd6a4da9c56edc6c49d753549659f8be602fb2 /include/utils
parent1337349ea11a6bb5c44ba5c5bb064c750bd626c5 (diff)
libutils: fix cache removal when callback invalidates the key
Bug: 24785286 Change-Id: I9d17d2247258a56ef7776b3a701389e825a9c533
Diffstat (limited to 'include/utils')
-rw-r--r--include/utils/LruCache.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/utils/LruCache.h b/include/utils/LruCache.h
index 1741fb2e4..ed96fe4ff 100644
--- a/include/utils/LruCache.h
+++ b/include/utils/LruCache.h
@@ -200,11 +200,11 @@ bool LruCache<TKey, TValue>::remove(const TKey& key) {
return false;
}
Entry* entry = *find_result;
+ mSet->erase(entry);
if (mListener) {
(*mListener)(entry->key, entry->value);
}
detachFromCache(*entry);
- mSet->erase(entry);
delete entry;
return true;
}