Function pyo3::gil::register_decref
source · pub unsafe fn register_decref(obj: NonNull<PyObject>)
Expand description
Registers a Python object pointer inside the release pool, to have its reference count decreased the next time the GIL is acquired in pyo3.
If the GIL is held, the reference count will be decreased immediately instead of being queued for later.
§Safety
The object must be an owned Python reference.