diff --git a/bindings/interface/SeparatorView.cpp b/bindings/interface/SeparatorView.cpp index c75e7ce..0907321 100644 --- a/bindings/interface/SeparatorView.cpp +++ b/bindings/interface/SeparatorView.cpp @@ -38,7 +38,7 @@ class PyBSeparatorView : public BSeparatorView{ PYBIND11_MODULE(SeparatorView,m) { -py::class_(m, "BSeparatorView") +py::class_>(m, "BSeparatorView") .def(py::init(), "", py::arg("orientation"), py::arg("border")=B_PLAIN_BORDER) .def(py::init(), "", py::arg("name"), py::arg("label"), py::arg("orientation")=B_HORIZONTAL, py::arg("border")=B_FANCY_BORDER, py::arg("alignment")=BAlignment(B_ALIGN_HORIZONTAL_CENTER,B_ALIGN_VERTICAL_CENTER)) .def(py::init(), "", py::arg("name"), py::arg("labelView"), py::arg("orientation")=B_HORIZONTAL, py::arg("border")=B_FANCY_BORDER, py::arg("alignment")=BAlignment(B_ALIGN_HORIZONTAL_CENTER,B_ALIGN_VERTICAL_CENTER)) diff --git a/tests/separatorViewHolderOwnership.py b/tests/separatorViewHolderOwnership.py new file mode 100644 index 0000000..2d82f95 --- /dev/null +++ b/tests/separatorViewHolderOwnership.py @@ -0,0 +1,46 @@ +import gc +import faulthandler + +faulthandler.enable() + +try: + import resource + resource.setrlimit(resource.RLIMIT_CORE, (0, 0)) +except Exception: + pass + +from Be import ( + BApplication, + BSeparatorView, + BRect, + BWindow, + B_HORIZONTAL, + B_NOT_RESIZABLE, + window_type, +) + + +application = BApplication( + "application/x-vnd.haiku-pyapi-bseparatorview-holder-test" +) + +window = BWindow( + BRect(100.0, 100.0, 360.0, 260.0), + "BSeparatorView holder test", + window_type.B_TITLED_WINDOW, + B_NOT_RESIZABLE, +) + +separator = BSeparatorView(B_HORIZONTAL) + +window.AddChild(separator, None) +window.Quit() + +del separator +gc.collect() + +del window +del application +gc.collect() + +print("BSEPARATORVIEW HOLDER OWNERSHIP REGRESSION TEST: PASS")