mirror of
https://github.com/pybind/pybind11.git
synced 2025-02-19 23:20:43 +00:00
Fix negative refcount in PyCapsule destructor
This commit is contained in:
parent
620a808ad0
commit
5687b337f9
@ -229,7 +229,7 @@ handle eigen_ref_array(Type &src, handle parent = none()) {
|
|||||||
// not the Type of the pointer given is const.
|
// not the Type of the pointer given is const.
|
||||||
template <typename props, typename Type, typename = enable_if_t<is_eigen_dense_plain<Type>::value>>
|
template <typename props, typename Type, typename = enable_if_t<is_eigen_dense_plain<Type>::value>>
|
||||||
handle eigen_encapsulate(Type *src) {
|
handle eigen_encapsulate(Type *src) {
|
||||||
capsule base(src, [](PyObject *o) { delete reinterpret_steal<capsule>(o).operator Type*(); });
|
capsule base(src, [](PyObject *o) { delete static_cast<Type *>(PyCapsule_GetPointer(o, nullptr)); });
|
||||||
return eigen_ref_array<props>(*src, base);
|
return eigen_ref_array<props>(*src, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user