Message263664
I think idea 2 (error if memoryview not released) would not work. It would rely on garbage collection, which is not always immediate. E.g. if the memoryview were kept alive by a reference cycle, it may not immediately be released. I don’t think idea 3 is worthwhile, because the memoryview API does not seem designed for this use case, and it would not be 100% consistent anyway.
So that leaves my first idea, to call view.release() when readinto(), etc, return. This should avoid the crash and data loss problems in some common cases. It is implemented in release-view.patch, along with some notes. |
|
Date |
User |
Action |
Args |
2016-04-18 13:40:11 | martin.panter | set | recipients:
+ martin.panter, jcea, vstinner, christian.heimes, ezio.melotti, Arfrever, skrah, sbt |
2016-04-18 13:40:10 | martin.panter | set | messageid: <1460986810.65.0.0942259810746.issue15994@psf.upfronthosting.co.za> |
2016-04-18 13:40:10 | martin.panter | link | issue15994 messages |
2016-04-18 13:40:10 | martin.panter | create | |
|