Merge branch 'master' into sh_merge_master

This commit is contained in:
Ralf W. Grosse-Kunstleve
2021-11-15 14:43:08 -08:00
15 changed files with 167 additions and 31 deletions

View File

@@ -2093,6 +2093,16 @@ inline std::pair<decltype(internals::registered_types_py)::iterator, bool> all_t
// gets destroyed:
weakref((PyObject *) type, cpp_function([type](handle wr) {
get_internals().registered_types_py.erase(type);
// TODO consolidate the erasure code in pybind11_meta_dealloc() in class.h
auto &cache = get_internals().inactive_override_cache;
for (auto it = cache.begin(), last = cache.end(); it != last; ) {
if (it->first == reinterpret_cast<PyObject *>(type))
it = cache.erase(it);
else
++it;
}
wr.dec_ref();
})).release();
}

View File

@@ -287,10 +287,10 @@ protected:
struct borrowed_t { };
struct stolen_t { };
#ifndef DOXYGEN_SHOULD_SKIP_THIS // Issue in breathe 4.26.1
/// @cond BROKEN
template <typename T> friend T reinterpret_borrow(handle);
template <typename T> friend T reinterpret_steal(handle);
#endif
/// @endcond
public:
// Only accessible from derived classes and the reinterpret_* functions
@@ -1717,7 +1717,7 @@ public:
#endif
};
#ifndef DOXYGEN_SHOULD_SKIP_THIS
/// @cond DUPLICATE
inline memoryview memoryview::from_buffer(
void *ptr, ssize_t itemsize, const char* format,
detail::any_container<ssize_t> shape,
@@ -1745,7 +1745,7 @@ inline memoryview memoryview::from_buffer(
throw error_already_set();
return memoryview(object(obj, stolen_t{}));
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
/// @endcond
/// @} pytypes
/// \addtogroup python_builtins