Hi all, i'm working on an app that embed python 2.3 with Gnu/Linux, and i'd like to have some precisions: I'm making python's modules to extend my application's functions with a built in script editor. At now all works very well, but i'd like to know if i'm not forgetting some references inc/dec.... Here is a portion of my code: static PyObject * Scene_GetNodeGraph(PyObject *self, PyObject *args) { NodeGraph* Ng = NodeGraph::GetInstance(); std::vector<String> NodG; Ng->GetNodeGraph(NodG); PyObject* List = PyList_New(NodG.size()); PyObject* Str = NULL; std::vector<String>::iterator it = NodG.begin(); int i = 0; for (;it != NodG.end();it++) { Str = PyString_FromString(it->AsChar()); PyList_SetItem(List,i,Str); i++; } return List; } Can someone take a look at this and tell me if i must add some inc/decref ? Thanks.
On Tue, Feb 01, 2005, cedric paille wrote:
Hi all, i'm working on an app that embed python 2.3 with Gnu/Linux, and i'd like to have some precisions:
python-dev is for the core developers to discuss bugs and patches. Please use comp.lang.python for questions about using Python. Thanks. -- Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/ "Given that C++ has pointers and typecasts, it's really hard to have a serious conversation about type safety with a C++ programmer and keep a straight face. It's kind of like having a guy who juggles chainsaws wearing body armor arguing with a guy who juggles rubber chickens wearing a T-shirt about who's in more danger." --Roy Smith, c.l.py, 2004.05.23
participants (2)
-
Aahz -
cedric paille