Fix illegal early call to PyBuffer_Release in swig typemaps
authorLawrence D'Anna <lawrence_danna@apple.com>
Tue, 7 Apr 2020 20:29:58 +0000 (13:29 -0700)
committerLawrence D'Anna <lawrence_danna@apple.com>
Tue, 7 Apr 2020 20:31:29 +0000 (13:31 -0700)
commitc8de17bca658e62bbf8c33eae839e457332e885e
treedb7476cc394181b9674ddf28f82249361f5c3816
parent0361798dbeb6ead0a79ab7985f02da347fce988e
Fix illegal early call to PyBuffer_Release in swig typemaps

Summary:
The buffer protocol does not allow us to just call PyBuffer_Release
and assume the buffer will still be there.   Most things that implement the
buffer protocol will let us get away with that, but not all.   We need
to release it at the end of the SWIG wrapper.

Reviewers: labath, jasonmolenda, JDevlieghere, vadimcn

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D77480
lldb/bindings/python/python-typemaps.swig