From d199bf60cf970d763b7f8a069d95e01abc1b91d2 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Sun, 18 Aug 2024 21:59:32 +1200 Subject: [PATCH] LibJS: Do not clear VM's string cache in Heap's destructor There is definitely a possibility I am misunderstanding the reason behind it - but this does not appear neccessary. The VM owns both the string cache and Heap. On destruction, the VM should clear out both the heap and its string cache. --- Libraries/LibJS/Heap/Heap.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Libraries/LibJS/Heap/Heap.cpp b/Libraries/LibJS/Heap/Heap.cpp index a5e735d13f1..8055311184e 100644 --- a/Libraries/LibJS/Heap/Heap.cpp +++ b/Libraries/LibJS/Heap/Heap.cpp @@ -43,8 +43,6 @@ Heap::Heap(VM& vm) Heap::~Heap() { - vm().string_cache().clear(); - vm().byte_string_cache().clear(); collect_garbage(CollectionType::CollectEverything); }