Fix nullptr dereference when loading an external-only module_local type

This commit is contained in:
Dean Moldovan
2017-09-03 01:31:47 +02:00
parent 3c4933cb50
commit 7b1de1e551
6 changed files with 40 additions and 6 deletions

View File

@@ -15,6 +15,10 @@
#include <numeric>
TEST_SUBMODULE(local_bindings, m) {
// test_load_external
m.def("load_external1", [](ExternalType1 &e) { return e.i; });
m.def("load_external2", [](ExternalType2 &e) { return e.i; });
// test_local_bindings
// Register a class with py::module_local:
bind_local<LocalType, -1>(m, "LocalType", py::module_local())