From edf64b801c46e806cdfc28145a25d41df6046b8d Mon Sep 17 00:00:00 2001 From: stelar7 Date: Fri, 25 Apr 2025 22:33:59 +0200 Subject: [PATCH] LibWeb/IDB: Add store to the current transaction when created --- Libraries/LibWeb/IndexedDB/IDBObjectStore.cpp | 1 + Libraries/LibWeb/IndexedDB/IDBTransaction.h | 1 + 2 files changed, 2 insertions(+) diff --git a/Libraries/LibWeb/IndexedDB/IDBObjectStore.cpp b/Libraries/LibWeb/IndexedDB/IDBObjectStore.cpp index b64ecb536af..1ab67d6e17e 100644 --- a/Libraries/LibWeb/IndexedDB/IDBObjectStore.cpp +++ b/Libraries/LibWeb/IndexedDB/IDBObjectStore.cpp @@ -24,6 +24,7 @@ IDBObjectStore::IDBObjectStore(JS::Realm& realm, GC::Ref store, GC: , m_transaction(transaction) , m_name(store->name()) { + transaction->add_to_scope(store); } GC::Ref IDBObjectStore::create(JS::Realm& realm, GC::Ref store, GC::Ref transaction) diff --git a/Libraries/LibWeb/IndexedDB/IDBTransaction.h b/Libraries/LibWeb/IndexedDB/IDBTransaction.h index 440e430e834..35019709527 100644 --- a/Libraries/LibWeb/IndexedDB/IDBTransaction.h +++ b/Libraries/LibWeb/IndexedDB/IDBTransaction.h @@ -61,6 +61,7 @@ public: [[nodiscard]] bool is_finished() const { return m_state == TransactionState::Finished; } GC::Ptr object_store_named(String const& name) const; + void add_to_scope(GC::Ref object_store) { m_scope.append(object_store); } WebIDL::ExceptionOr abort(); WebIDL::ExceptionOr commit();