The fix for #960 could result a type being registered multiple times if its `__init__` is called multiple times. This can happen perfectly ordinarily when python-side multiple inheritance is involved: for example, with a diamond inheritance pattern with each intermediate classes invoking the parent constructor. With the change in #960, the multiple `__init__` calls meant `register_instance` was called multiple times, but the deletion only deleted it once. Thus, if a future instance of the same type was allocated at the same location, pybind would pick it up as a registered type. This fixes the issue by tracking whether a value pointer has been registered to avoid both double-registering it. (There's also a slight optimization of not needing to do a registered_instances lookup when the type is known not registered, but this is secondary).
| Name |
Last commit
|
Last Update |
|---|---|---|
| docs | Loading commit data... | |
| include/pybind11 | Loading commit data... | |
| pybind11 | Loading commit data... | |
| tests | Loading commit data... | |
| tools | Loading commit data... | |
| .appveyor.yml | Loading commit data... | |
| .gitignore | Loading commit data... | |
| .gitmodules | Loading commit data... | |
| .readthedocs.yml | Loading commit data... | |
| .travis.yml | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| CONTRIBUTING.md | Loading commit data... | |
| ISSUE_TEMPLATE.md | Loading commit data... | |
| LICENSE | Loading commit data... | |
| MANIFEST.in | Loading commit data... | |
| README.md | Loading commit data... | |
| setup.cfg | Loading commit data... | |
| setup.py | Loading commit data... |