diff options
author | Daniel van Vugt <daniel.van.vugt@canonical.com> | 2023-04-05 17:48:22 +0800 |
---|---|---|
committer | Daniel van Vugt <daniel.van.vugt@canonical.com> | 2023-04-13 14:35:28 +0800 |
commit | 1b49495e762e051d60c7e2efda038de9eea4a214 (patch) | |
tree | 927e988e7d2235a9a38b29b1014727482914a073 | |
parent | 3be5116537e45984ecaf8f6c522ff6613aa7d9d4 (diff) | |
download | gjs-1b49495e762e051d60c7e2efda038de9eea4a214.tar.gz |
context: Clear all vectors of JS::Heap on dispose
Otherwise we might still have some `JS::Heap`s lingering after
`JS_DestroyContext`, which will fail to destruct (crash) when their
destructors are called later in `~GjsContextPrivate()`.
Fixes: https://gitlab.gnome.org/GNOME/gjs/-/issues/472
-rw-r--r-- | gjs/context.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gjs/context.cpp b/gjs/context.cpp index 59ac8afd..6c66f1ac 100644 --- a/gjs/context.cpp +++ b/gjs/context.cpp @@ -471,6 +471,9 @@ void GjsContextPrivate::dispose(void) { delete m_gtype_table; delete m_atoms; + m_job_queue.clear(); + m_object_init_list.clear(); + /* Tear down JS */ JS_DestroyContext(m_cx); m_cx = nullptr; |