Skip to content

Commit 5b9deec

Browse files
committed
set GLOBAL_CX = null in the final cleanup function since it's no longer usable/useful after the context is destroyed
1 parent dda2916 commit 5b9deec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/modules/pythonmonkey/pythonmonkey.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,10 @@ static void cleanup() {
310310
// Clean up SpiderMonkey
311311
delete autoRealm;
312312
delete global;
313-
if (GLOBAL_CX) JS_DestroyContext(GLOBAL_CX);
313+
if (GLOBAL_CX) {
314+
JS_DestroyContext(GLOBAL_CX);
315+
GLOBAL_CX = nullptr;
316+
}
314317
delete JOB_QUEUE;
315318
JS_ShutDown();
316319
}

0 commit comments

Comments
 (0)