Skip to content

Commit

Permalink
Merge pull request #1 from Blistic/issue1568
Browse files Browse the repository at this point in the history
Fix deallocation of incorrect pointer (pybind#1568)
  • Loading branch information
Blistic authored Nov 4, 2018
2 parents 978d439 + aa4113b commit 691f455
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/pybind11/detail/class.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ inline bool deregister_instance_impl(void *ptr, instance *self) {
auto &registered_instances = get_internals().registered_instances;
auto range = registered_instances.equal_range(ptr);
for (auto it = range.first; it != range.second; ++it) {
if (Py_TYPE(self) == Py_TYPE(it->second)) {
if (self == it->second) {
registered_instances.erase(it);
return true;
}
Expand Down

0 comments on commit 691f455

Please sign in to comment.