43,44c43,48
< std::vector<PythonReadyFunc *> pythonReadyFuncs;
< std::vector<PythonInitFunc *> pythonInitFuncs;
---
> PythonReadyFunc *&
> firstReadyFunc()
> {
> static PythonReadyFunc *first = nullptr;
> return first;
> }
45a50,56
> PythonInitFunc *&
> firstInitFunc()
> {
> static PythonInitFunc *first = nullptr;
> return first;
> }
>
49,50c60,61
< for (auto &func: pythonReadyFuncs)
< func->run();
---
> for (auto ptr = firstReadyFunc(); ptr; ptr = ptr->next)
> ptr->run();
58,59c69,70
< for (auto &func: pythonInitFuncs)
< func->run(m);
---
> for (auto ptr = firstInitFunc(); ptr; ptr = ptr->next)
> ptr->run(m);
65c76
< PythonReadyFunc::PythonReadyFunc()
---
> PythonReadyFunc::PythonReadyFunc() : next(firstReadyFunc())
67c78
< pythonReadyFuncs.push_back(this);
---
> firstReadyFunc() = this;
70c81
< PythonInitFunc::PythonInitFunc()
---
> PythonInitFunc::PythonInitFunc() : next(firstInitFunc())
72c83
< pythonInitFuncs.push_back(this);
---
> firstInitFunc() = this;