-
How do I interpret the following?
Is it a bug on my part for getting something wrong in binding code or is it an issue with nanobind? Thanks for your help in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
Yes, this most likely means that there is a bug in your program. I recommend minimizing the bindings as much as possible to produce a tiny reproducer that could be posted here. Probably you will realize what the problem is along the way. |
Beta Was this translation helpful? Give feedback.
-
For anyone running into this in the future: the problem arises due to a reference leak in To avoid this issue, a set of LRU caches related to type information must be cleared before interpreter shutdown, which can be accomplished by running the following anywhere (just once is enough).
In any case, this is not a nanobind issue. It's just that nanobind complains very loudly about leaks (a good thing!) which revealed this issue. |
Beta Was this translation helpful? Give feedback.
For anyone running into this in the future: the problem arises due to a reference leak in
typing
(not exactly this issue, but this is what pointed me into the right direction: https://bugs.python.org/issue28649).To avoid this issue, a set of LRU caches related to type information must be cleared before interpreter shutdown, which can be accomplished by running the following anywhere (just once is enough).
In any case, this is not a nanobind issue. It's just that nanobind complains very loudly about leaks (a good thing!) which …