We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 688c96b commit 62865b0Copy full SHA for 62865b0
1 file changed
cppgc-repro/binding.cc
@@ -1,6 +1,8 @@
1
// Minimal reproduction: cppgc::MakeGarbageCollected crashes inside an addon on
2
// arm64 macOS. Build with node-gyp; call `make()` from JS.
3
#include <cstdio>
4
+#include <mutex>
5
+#include <vector>
6
#include <node.h>
7
#include <v8.h>
8
@@ -9,9 +11,15 @@
9
11
#include "cppgc/visitor.h"
10
12
#include "v8-cppgc.h"
13
14
+// Match node-gtk's ClosureTracer: non-trivial (mutex + vector + destructor), so
15
+// cppgc registers a finalizer for it. The trivial version did NOT crash.
16
class Wrappable final : public cppgc::GarbageCollected<Wrappable> {
17
public:
18
void Trace(cppgc::Visitor*) const {}
19
+ ~Wrappable() { v.clear(); }
20
+ private:
21
+ mutable std::mutex m;
22
+ std::vector<void*> v;
23
};
24
25
static void Make(const v8::FunctionCallbackInfo<v8::Value>& info) {
0 commit comments