mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-29 00:22:00 +00:00
fix for virtual dispatch on newly created threads
This commit is contained in:
parent
71c5d80a91
commit
b2b44a9af8
@ -10,7 +10,9 @@ Changelog
|
|||||||
* Added a convenience routine ``make_iterator()`` which turns a range indicated
|
* Added a convenience routine ``make_iterator()`` which turns a range indicated
|
||||||
by a pair of C++ iterators into a iterable Python object
|
by a pair of C++ iterators into a iterable Python object
|
||||||
* Added ``len()`` and a variadic ``make_tuple()`` function
|
* Added ``len()`` and a variadic ``make_tuple()`` function
|
||||||
* Addressed a rare issue that could confuse the current virtual function dispatcher
|
* Addressed a rare issue that could confuse the current virtual function
|
||||||
|
dispatcher and another that could lead to crashes in multi-threaded
|
||||||
|
applications
|
||||||
* Added a ``get_include()`` function to the Python module that returns the path
|
* Added a ``get_include()`` function to the Python module that returns the path
|
||||||
of the directory containing the installed pybind11 header files
|
of the directory containing the installed pybind11 header files
|
||||||
* Documentation improvements: import issues, symbol visibility, pickling, limitations
|
* Documentation improvements: import issues, symbol visibility, pickling, limitations
|
||||||
|
@ -1070,7 +1070,7 @@ inline function get_overload(const void *this_ptr, const char *name) {
|
|||||||
|
|
||||||
/* Don't call dispatch code if invoked from overridden function */
|
/* Don't call dispatch code if invoked from overridden function */
|
||||||
PyFrameObject *frame = PyThreadState_Get()->frame;
|
PyFrameObject *frame = PyThreadState_Get()->frame;
|
||||||
if ((std::string) pybind11::handle(frame->f_code->co_name).str() == name &&
|
if (frame && (std::string) pybind11::handle(frame->f_code->co_name).str() == name &&
|
||||||
frame->f_code->co_argcount > 0) {
|
frame->f_code->co_argcount > 0) {
|
||||||
PyFrame_FastToLocals(frame);
|
PyFrame_FastToLocals(frame);
|
||||||
PyObject *self_caller = PyDict_GetItem(
|
PyObject *self_caller = PyDict_GetItem(
|
||||||
|
Loading…
Reference in New Issue
Block a user