We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f414ea5 commit 1a81256Copy full SHA for 1a81256
1 file changed
dynd/include/utility_functions.hpp
@@ -384,8 +384,10 @@ class py_ref_tmpl {
384
}
385
386
387
- // Return an owned reference to the encapsulated PyObject as a raw pointer.
+ // Return a reference to the encapsulated PyObject as a raw pointer.
388
// Set the encapsulated pointer to NULL.
389
+ // If this is a type that owns its reference, an owned reference is returned.
390
+ // If this is a type that wraps a borrowed reference, a borrowed reference is returned.
391
PyObject *release() noexcept
392
{
393
// If the contained reference should not be null, assert that it isn't.
@@ -394,7 +396,6 @@ class py_ref_tmpl {
394
396
PYDYND_ASSERT_IF(o != nullptr, Py_REFCNT(o) > 0);
395
397
auto ret = o;
398
o = nullptr;
- incref_if_owned<!owns_ref, not_null>(ret);
399
return ret;
400
401
0 commit comments