Skip to content

Commit

Permalink
light edits
Browse files Browse the repository at this point in the history
  • Loading branch information
bpcreech committed Apr 9, 2024
1 parent 0800081 commit 13cd34d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions content/post/mini-racer-v0.11.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -697,9 +697,11 @@ what happens now is:
`BinaryValue` objects down. This avoids a memory leak, and avoids dangling
pointers on the C++ side.

2. When Python later calls `_ValueHandle.__del__`, it passes a context ID to
`MiniRacer::ContextFactory`. This context ID is no longer valid because the
context was torn down already. Thus, this call can be safely ignored.
2. When Python later calls `_ValueHandle.__del__`, it passes both a context ID
_and_ the value handle to `MiniRacer::ContextFactory`.
`MiniRacer::ContextFactory` notices that the whole context ID is no longer
valid because the context was torn down already. The context and its values
are already gone. Thus, this call can be safely ignored.

I think the design strategy is generalizable to most Python/C++ integrations,
and potentially likewise Java/C++ and C#/C++ integrations. (_TL;DR: use integer
Expand Down

0 comments on commit 13cd34d

Please sign in to comment.