boostorg / boostorg/python

About the reference count of python-side returned objects

Đang mở
#220 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C++
Star
537
Fork
223
Merge trung bình
11 giờ 22 phút
Pull request đã merge (30 ngày)
2

Mô tả

Hi there, if I use boost_python to call a python side function and get a boost::python::object return, it seems that the reference count of wrapped obj.ptr() is at least 1 as they are set to one when created. But I don't think the reference count will be reduced automatically when boost::python::object is destructed (please correct me if I am wrong). If so, how can this memory be freed, should we manually decrease the reference count so that python GC can work? This is especially important if a large object like numpy::ndarray if returned, I am not sure whether C-side or Py-side should take charge of freeing the memory. Thanks in advance!

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.