File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -384,8 +384,10 @@ class py_ref_tmpl {
384
384
}
385
385
}
386
386
387
- // Return an owned reference to the encapsulated PyObject as a raw pointer.
387
+ // Return a reference to the encapsulated PyObject as a raw pointer.
388
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.
389
391
PyObject *release () noexcept
390
392
{
391
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;
396
398
o = nullptr ;
397
- incref_if_owned<!owns_ref, not_null>(ret);
398
399
return ret;
399
400
}
400
401
You can’t perform that action at this time.
0 commit comments