about summary refs log tree commit diff stats
path: root/adapter/tools/urldec.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-06-03 20:28:29 +0200
committerbptato <nincsnevem662@gmail.com>2024-06-03 20:28:29 +0200
commitdfb03387691e72f8832734255765ddfdd38db372 (patch)
tree31f2c489859aa8bd7d7bc2b3b1854f11708b45f2 /adapter/tools/urldec.nim
parent34b0abd1a5811afa88b16442c0dc327881456d8f (diff)
downloadchawan-dfb03387691e72f8832734255765ddfdd38db372.tar.gz
js: fix runtime cleanup
This is a minefield.

Intuitively, you would think that just clearing the opaque and manually
freeing registered object should be enough. Unfortunately, this is
not true; we do not store whether we are actually holding a reference to
registered JS objects, so this approach leads to double frees.

Instead, we add a QJS callback that is called right after the final
GC cleanup, but before the list_free assertion. This way, we can be sure
that any object still in our registry is referenced by us, and can
therefore unreference them safely.
Diffstat (limited to 'adapter/tools/urldec.nim')
0 files changed, 0 insertions, 0 deletions