diff options
author | 2022-11-19 01:25:15 -0800 | |
---|---|---|
committer | 2022-11-19 01:25:15 -0800 | |
commit | 38b5a85d8ae030acdead6d169735317a66d23d94 (patch) | |
tree | 1ba151be5b76f6e3bc2ed1a992b4659608f25576 /src/bun.js/bindings/ZigGeneratedClasses.cpp | |
parent | 68b55cd855249964fbb9b9d74d1303cae9993904 (diff) | |
download | bun-38b5a85d8ae030acdead6d169735317a66d23d94.tar.gz bun-38b5a85d8ae030acdead6d169735317a66d23d94.tar.zst bun-38b5a85d8ae030acdead6d169735317a66d23d94.zip |
Fix a GC issue with `Bun.spawn`
The `Subprocess` object stays alive until the process exits, even if it's never referenced
Diffstat (limited to 'src/bun.js/bindings/ZigGeneratedClasses.cpp')
-rw-r--r-- | src/bun.js/bindings/ZigGeneratedClasses.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/bun.js/bindings/ZigGeneratedClasses.cpp b/src/bun.js/bindings/ZigGeneratedClasses.cpp index 40ced4888..5618245cf 100644 --- a/src/bun.js/bindings/ZigGeneratedClasses.cpp +++ b/src/bun.js/bindings/ZigGeneratedClasses.cpp @@ -3,14 +3,15 @@ // Generated by make codegen #include "root.h" +#include "BunClientData.h" +#include "ZigGlobalObject.h" + #include <JavaScriptCore/JSFunction.h> #include <JavaScriptCore/InternalFunction.h> #include <JavaScriptCore/LazyClassStructure.h> #include <JavaScriptCore/LazyClassStructureInlines.h> #include <JavaScriptCore/FunctionPrototype.h> -#include "ZigGlobalObject.h" - #include <JavaScriptCore/DOMJITAbstractHeap.h> #include "DOMJITIDLConvert.h" #include "DOMJITIDLType.h" @@ -2033,6 +2034,12 @@ extern "C" EncodedJSValue Subprocess__getConstructor(Zig::GlobalObject* globalOb return JSValue::encode(globalObject->JSSubprocessConstructor()); } +extern "C" bool Subprocess__hasPendingActivity(void* ptr); +bool JSSubprocess::internalHasPendingActivity() +{ + return Subprocess__hasPendingActivity(m_ctx); +} + JSSubprocess::~JSSubprocess() { if (m_ctx) { |