HashMap: Fix the build with GCC 7.

This commit is contained in:
Augustin Cavalier
2019-02-14 19:52:45 -05:00
parent b6840f3610
commit fc8e5be1c8
2 changed files with 10 additions and 3 deletions
+9 -1
View File
@@ -163,7 +163,7 @@ public:
typedef typename HashMap<Key, Value>::Iterator Iterator;
SynchronizedHashMap() : Locker("synchronized hash map") {}
~SynchronizedHashMap() { Lock(); }
~SynchronizedHashMap() { Locker::Lock(); }
status_t InitCheck() const
{
@@ -186,6 +186,14 @@ public:
return fMap.Remove(key);
}
Value Remove(Iterator& it)
{
MapLocker locker(this);
if (!locker.IsLocked())
return Value();
return fMap.Remove(it);
}
void Clear()
{
MapLocker locker(this);
@@ -85,7 +85,6 @@ BNetworkCookieJar::~BNetworkCookieJar()
PrivateHashMap::Iterator it = fCookieHashMap->GetIterator();
while (it.HasNext()) {
BNetworkCookieList* list = it.Next().value;
it.Remove();
list->LockForWriting();
delete list;
}
@@ -787,7 +786,7 @@ BNetworkCookieJar::UrlIterator::Remove()
fLastList->RemoveItemAt(fLastIndex);
if (fLastList->CountItems() == 0) {
fIterator->fCookieMapIterator.Remove();
fCookieJar->fCookieHashMap->Remove(fIterator->fCookieMapIterator);
delete fLastList;
fLastList = NULL;
} else {