We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 244b1aa commit 4fe3cd8Copy full SHA for 4fe3cd8
include/pybind11/detail/class.h
@@ -222,7 +222,7 @@ inline bool deregister_instance_impl(void *ptr, instance *self) {
222
auto ®istered_instances = get_internals().registered_instances;
223
auto range = registered_instances.equal_range(ptr);
224
for (auto it = range.first; it != range.second; ++it) {
225
- if (Py_TYPE(self) == Py_TYPE(it->second)) {
+ if (self == it->second && Py_TYPE(self) == Py_TYPE(it->second)) {
226
registered_instances.erase(it);
227
return true;
228
}
0 commit comments