From e7f50908081b31203877a1092c60d73be256ad70 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Mon, 21 Sep 2020 01:31:49 +0330 Subject: [PATCH] Spreadsheet: Always keep the workbook interpreter in VM scope Fixes #3570. --- Applications/Spreadsheet/Workbook.cpp | 1 + Applications/Spreadsheet/Workbook.h | 1 + 2 files changed, 2 insertions(+) diff --git a/Applications/Spreadsheet/Workbook.cpp b/Applications/Spreadsheet/Workbook.cpp index 941d8d356ac..252bb1d93ee 100644 --- a/Applications/Spreadsheet/Workbook.cpp +++ b/Applications/Spreadsheet/Workbook.cpp @@ -48,6 +48,7 @@ static JS::VM& global_vm() Workbook::Workbook(NonnullRefPtrVector&& sheets) : m_sheets(move(sheets)) , m_interpreter(JS::Interpreter::create(global_vm())) + , m_interpreter_scope(JS::VM::InterpreterScope(interpreter())) { m_workbook_object = interpreter().heap().allocate(global_object(), *this); global_object().put("workbook", workbook_object()); diff --git a/Applications/Spreadsheet/Workbook.h b/Applications/Spreadsheet/Workbook.h index 7c31db1f31d..60b12748ca7 100644 --- a/Applications/Spreadsheet/Workbook.h +++ b/Applications/Spreadsheet/Workbook.h @@ -66,6 +66,7 @@ public: private: NonnullRefPtrVector m_sheets; NonnullOwnPtr m_interpreter; + JS::VM::InterpreterScope m_interpreter_scope; WorkbookObject* m_workbook_object { nullptr }; String m_current_filename;