PetterS / quickjs

Thin Python wrapper of https://bellard.org/quickjs/
https://github.com/bellard/QuickJS
MIT License
177 stars 19 forks source link

Enable GC for Context and Object #78

Closed qwenger closed 2 years ago

qwenger commented 2 years ago

Fix #77.

Context and Object have a dependency cycle when an Object is used as or within a callable (Object's remember their Context, Context's maintain a list of their Python callables), therefore they cannot always simply be freed by reference counting, we need GC too.

It turns out that GC is not enabled by default in the C-API, it has to be set up explicitly.

PetterS commented 2 years ago

This is probably great, thanks! 👍🏼 I am not familiar with the GC API yet, so I'll have to study this a bit more in order to properly review it.

qwenger commented 2 years ago

Hi @PetterS , happy new year! (with a bit of delay...)

Did you have time to study the GC API yet? Or do you have at least an ETA for merging this PR?

PetterS commented 2 years ago

Very sorry for not being more active on Github.

This seems to fix things for several users, so let's merge it.