diff -Nru gjs-1.72.2/debian/changelog gjs-1.72.2/debian/changelog --- gjs-1.72.2/debian/changelog 2022-08-10 16:26:00.000000000 +0000 +++ gjs-1.72.2/debian/changelog 2023-05-19 11:12:55.000000000 +0000 @@ -1,3 +1,10 @@ +gjs (1.72.2-0ubuntu2) jammy; urgency=medium + + [ Daniel van Vugt ] + * Add context-Clear-all-vectors-of-JS-Heap-on-dispose.patch (LP: #1974293) + + -- Ghadi Elie Rahme Fri, 19 May 2023 11:12:55 +0000 + gjs (1.72.2-0ubuntu1) jammy; urgency=medium * New upstream release (LP: #1981722) diff -Nru gjs-1.72.2/debian/patches/context-Clear-all-vectors-of-JS-Heap-on-dispose.patch gjs-1.72.2/debian/patches/context-Clear-all-vectors-of-JS-Heap-on-dispose.patch --- gjs-1.72.2/debian/patches/context-Clear-all-vectors-of-JS-Heap-on-dispose.patch 1970-01-01 00:00:00.000000000 +0000 +++ gjs-1.72.2/debian/patches/context-Clear-all-vectors-of-JS-Heap-on-dispose.patch 2023-05-19 11:12:55.000000000 +0000 @@ -0,0 +1,32 @@ +From: Daniel van Vugt +Date: Wed, 5 Apr 2023 17:48:22 +0800 +Subject: 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 + +Bug-Ubuntu: https://launchpad.net/bugs/1974293 +Origin: backport, https://gitlab.gnome.org/GNOME/gjs/-/merge_requests/834 +Forwarded: yes +Last-Update: 2023-04-11 +--- + gjs/context.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/gjs/context.cpp b/gjs/context.cpp + +--- a/gjs/context.cpp ++++ b/gjs/context.cpp +@@ -417,6 +417,9 @@ + void GjsContextPrivate::dispose(void) { + if (m_cx) { + stop_draining_job_queue(); ++ m_job_queue.clear(); ++ ++ m_object_init_list.clear(); + + gjs_debug(GJS_DEBUG_CONTEXT, + "Notifying reference holders of GjsContext dispose"); diff -Nru gjs-1.72.2/debian/patches/series gjs-1.72.2/debian/patches/series --- gjs-1.72.2/debian/patches/series 2022-08-10 16:26:00.000000000 +0000 +++ gjs-1.72.2/debian/patches/series 2023-05-19 11:12:55.000000000 +0000 @@ -0,0 +1 @@ +context-Clear-all-vectors-of-JS-Heap-on-dispose.patch