X-Git-Url: http://woldlab.caltech.edu/gitweb/?a=blobdiff_plain;f=py%2Fpython.cpp;h=0de06766470fd882e0f7a0bd857800973718fa7d;hb=c713e41c854b6038dafe6405a6cee74a246bd0a0;hp=75a844fbe6d9080b4111e764ab5b6e2592e8f7ee;hpb=e7b789759fa427e7f2b6440ca18d44a5d0210974;p=mussa.git diff --git a/py/python.cpp b/py/python.cpp index 75a844f..0de0676 100644 --- a/py/python.cpp +++ b/py/python.cpp @@ -133,11 +133,16 @@ py::object MussaPython::operator[](std::string name) } //! return a reference to a single mussa python interpreter -MussaPython *get_py() +MussaPython *get_py_ptr() { static MussaPython *py; if (!py) { py = new MussaPython; } return py; +} + +MussaPython &get_py() +{ + return *get_py_ptr(); } \ No newline at end of file