Description
The example code in VC 2017 give a leak tip in debug mode.
Output windows show text like this:
Detected memory leaks!
Dumping objects ->
{266} normal block at 0x00C9B4E8, 4 bytes long.
Data: < > 00 00 00 00
Object dump complete.
I had try the code in Win32 Application, it's OK, no leak.
The version of Visual Stuido 2017 I'm using is 15.9.16.
It seem the "internals_pp" pointer did not release.
In "internals.h" file of function "inline internals **&get_internals_pp() ".
Reproducible example code
namespace py = pybind11;
py::scoped_interpreter guard{};
auto dtPassTo = py::dict();
auto global = py::dict(py::module::import("main").attr("dict"));
dtPassTo["msg"] = py::cpp_function(
[](std::string strMsg) {
::MessageBoxA(nullptr, strMsg.c_str(), "", MB_OK);
});
py::exec("msg('test')", global, dtPassTo);