Skip to content

Truly independent web browser

LibWeb: Drop cleared weak entries when an IDB connection dissociates

Shannon Booth370a5300b598
diff --git a/Libraries/LibWeb/IndexedDB/Internal/Database.cpp b/Libraries/LibWeb/IndexedDB/Internal/Database.cpp
index 8533e53c5e2..19ff4fabbbc 100644
--- a/Libraries/LibWeb/IndexedDB/Internal/Database.cpp
+++ b/Libraries/LibWeb/IndexedDB/Internal/Database.cpp
@@ -136,7 +136,7 @@ void Database::associate(GC::Ref<IDBDatabase> connection)
void Database::dissociate(IDBDatabase& connection)
{
- m_associated_connections.remove_first_matching([&](auto& entry) { return entry == &connection; });
+ m_associated_connections.remove_all_matching([&](auto& entry) { return !entry || entry == &connection; });
}
GC::Ref<Database::AssociatedConnections> Database::associated_connections_as_heap_vector(GC::Heap& heap)