Hi Michael, On Wed, Jun 15, 2005 at 03:26:00PM +0100, Michael Hudson wrote: > > Hum, you probably don't want to know, but it works just fine to forget > > a Py_INCREF before PyModule_AddObject() for the following reason: > > No, it's more complicated than that, at least in an embedded > scenario (see bug #1220756). Uh, yes, indeed. I guess that my explanations don't survive an interpreter shutdown, after which the reference counter of the object effectively drops to zero. I don't see how this doesn't crash Python when you exit. It could be that the gc is not called after the reference from the import mechanism was effectively removed -- type objects after a PyType_Ready() are full of ref cycles. But it's all quite obscure. Armin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4