Skip to content

Commit 68c9011

Browse files
committed
fix: explicitly chain object lifetimes
The tests were previously encountering issues because creating an encryption/decryption context would not necessarily keep the parent `mongocrypt_t` alive, leading to intermittent crashes. It appears that a similar issue has shown itself in the past w.r.t. KMS requests; the solution chosen there was to "chain" the object lifetimes through a JS property link on the wrapper objects for each C++ object. This approach mostly works, but it is a bit brittle, because the JS engine and Node-API do not make strict guarantees about the order in which C++ wrapper objects are destroyed. This commit tries to fully solve this problem by leaving it to the C++ wrapper objects to explicitly define lifetime relationships between them.
1 parent 415ebd1 commit 68c9011

File tree

5 files changed

+165
-84
lines changed

5 files changed

+165
-84
lines changed

0 commit comments

Comments
 (0)