MCPcopy Create free account
hub / github.com/pybind/pybind11 / clear

Method clear

tests/mod_per_interpreter_gil_with_singleton.cpp:62–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60 }
61
62 static void clear() {
63 auto &instance = get_instance();
64 (void) instance; // suppress unused variable warning
65 assert(instance.objects.size() == 7);
66 for (const auto &obj : instance.objects) {
67 obj.dec_ref();
68 }
69 instance.objects.clear();
70 }
71
72private:
73 std::vector<py::handle> objects;

Callers

nothing calls this directly

Calls 2

dec_refMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected