Skip to content

Commit

Permalink
Apply pybind11 commit 2b6b98e to avoid crash
Browse files Browse the repository at this point in the history
  • Loading branch information
wcaarls committed Oct 29, 2024
1 parent 2f0b400 commit c3f2f70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions addons/python/src/grlpy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ PYBIND11_MODULE(grlpy, m) {
mycfg.set(item.first.attr("__str__")().cast<std::string>(), item.second.attr("__str__")().cast<std::string>());

conf.reconfigure(mycfg);
})
.def("reset", [](Configurable &conf) {
conf.reset();
});

// Experiment
Expand Down
4 changes: 3 additions & 1 deletion externals/pybind11/include/pybind11/detail/class.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ 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)) {
// #2252 / 2b6b98e
//if (Py_TYPE(self) == Py_TYPE(it->second)) {
if (self == it->second) {
registered_instances.erase(it);
return true;
}
Expand Down

0 comments on commit c3f2f70

Please sign in to comment.