| 56 | namespace bmf_sdk { |
| 57 | |
| 58 | class PythonObject { |
| 59 | py::object obj_; |
| 60 | |
| 61 | public: |
| 62 | PythonObject(py::object &obj) : obj_(obj) {} |
| 63 | |
| 64 | py::object &obj() { return obj_; } |
| 65 | |
| 66 | ~PythonObject() { |
| 67 | py::gil_scoped_acquire gil; |
| 68 | obj_ = py::object(); |
| 69 | } |
| 70 | }; |
| 71 | |
| 72 | } // namespace bmf_sdk |
| 73 |