501ff8a17d
We already have checks in place to avoid borrowing these classes on other threads but it was still possible to send them to another thread and drop them there (while holding the GIL). This change avoids running the `Drop` implementation in such a case even though Python will still free the underlying memory. This might leak resources owned by the object, but it avoids undefined behaviour due to access the unsendable type from another thread. This does assume that the object was not unsafely integrated into an intrusive data structures which still point to the now freed memory. In that case, the only recourse would be to abort the process as freeing the memory is unavoidable when the tp_dealloc slot is called. (And moving it elsewhere into a new allocation would still break any existing pointers.) |
||
---|---|---|
.. | ||
.gitignore | ||
2881.changed.md | ||
2980.added.md | ||
2980.changed.md | ||
2981.removed.md | ||
3004.changed.md | ||
3016.added.md | ||
3029.changed.md | ||
3036.fixed.md | ||
3050.changed.md | ||
3062.fixed.md | ||
3066.changed.md | ||
3111.changed.md | ||
3120.added.md | ||
3131.changed.md | ||
3141.added.md | ||
3142.fixed.md | ||
3146.added.md | ||
3152.packaging.md | ||
3157.added.md | ||
3158.added.md | ||
3161.added.md | ||
3176.fixed.md | ||
3178.fixed.md |