summaryrefslogtreecommitdiff
path: root/ext/pybind11/docs/advanced/smart_ptrs.rst
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pybind11/docs/advanced/smart_ptrs.rst')
-rw-r--r--ext/pybind11/docs/advanced/smart_ptrs.rst6
1 files changed, 1 insertions, 5 deletions
diff --git a/ext/pybind11/docs/advanced/smart_ptrs.rst b/ext/pybind11/docs/advanced/smart_ptrs.rst
index e4a238603..da57748ca 100644
--- a/ext/pybind11/docs/advanced/smart_ptrs.rst
+++ b/ext/pybind11/docs/advanced/smart_ptrs.rst
@@ -63,16 +63,12 @@ code?
std::shared_ptr<Child> child;
};
- PYBIND11_PLUGIN(example) {
- py::module m("example");
-
+ PYBIND11_MODULE(example, m) {
py::class_<Child, std::shared_ptr<Child>>(m, "Child");
py::class_<Parent, std::shared_ptr<Parent>>(m, "Parent")
.def(py::init<>())
.def("get_child", &Parent::get_child);
-
- return m.ptr();
}
The following Python code will cause undefined behavior (and likely a