MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / drop

Method drop

src/objects/object.rs:62–67  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

60/// Dropping a `PyObject` decrements the reference count on the object by 1.
61impl Drop for PyObject {
62 fn drop(&mut self) {
63 let _gil_guard = Python::acquire_gil();
64 unsafe {
65 ffi::Py_DECREF(self.ptr.as_ptr());
66 }
67 }
68}
69
70impl PythonObject for PyObject {

Callers

nothing calls this directly

Calls 2

Py_DECREFFunction · 0.50
as_ptrMethod · 0.45

Tested by

no test coverage detected