diff options
author | Mark Spruiell <mes@zeroc.com> | 2012-09-04 14:08:40 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2012-09-04 14:08:40 -0700 |
commit | 5bc41da6912e65268bb55fe1b6fbb184a99796e1 (patch) | |
tree | a4254c7526c44ac569c327acae15e7dbfc23f5ca /py/modules/IcePy/PropertiesAdmin.cpp | |
parent | Partial Python port of PropertiesAdminUpdateCallback (diff) | |
download | ice-5bc41da6912e65268bb55fe1b6fbb184a99796e1.tar.bz2 ice-5bc41da6912e65268bb55fe1b6fbb184a99796e1.tar.xz ice-5bc41da6912e65268bb55fe1b6fbb184a99796e1.zip |
python fixes
Diffstat (limited to 'py/modules/IcePy/PropertiesAdmin.cpp')
-rw-r--r-- | py/modules/IcePy/PropertiesAdmin.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/py/modules/IcePy/PropertiesAdmin.cpp b/py/modules/IcePy/PropertiesAdmin.cpp index a6b548a0696..ca87b04261b 100644 --- a/py/modules/IcePy/PropertiesAdmin.cpp +++ b/py/modules/IcePy/PropertiesAdmin.cpp @@ -118,7 +118,7 @@ extern "C" static PyObject* nativePropertiesAdminAddUpdateCB(NativePropertiesAdminObject* self, PyObject* args) { - PyObject* callbackType = lookupType("Ice.PropertiersAdminUpdateCallback"); + PyObject* callbackType = lookupType("Ice.PropertiesAdminUpdateCallback"); PyObject* callback; if(!PyArg_ParseTuple(args, STRCAST("O!"), callbackType, &callback)) { @@ -127,6 +127,7 @@ nativePropertiesAdminAddUpdateCB(NativePropertiesAdminObject* self, PyObject* ar (*self->callbacks).push_back(new UpdateCallbackWrapper(callback)); (*self->admin)->addUpdateCallback((*self->callbacks).back()); + Py_INCREF(Py_None); return Py_None; } @@ -136,7 +137,7 @@ extern "C" static PyObject* nativePropertiesAdminRemoveUpdateCB(NativePropertiesAdminObject* self, PyObject* args) { - PyObject* callbackType = lookupType("Ice.PropertiersAdminUpdateCallback"); + PyObject* callbackType = lookupType("Ice.PropertiesAdminUpdateCallback"); PyObject* callback; if(!PyArg_ParseTuple(args, STRCAST("O!"), callbackType, &callback)) { @@ -149,19 +150,20 @@ nativePropertiesAdminRemoveUpdateCB(NativePropertiesAdminObject* self, PyObject* if((*p)->getObject() == callback) { (*self->admin)->removeUpdateCallback(*p); - return Py_None; + break; } } + Py_INCREF(Py_None); return Py_None; } - static PyMethodDef NativePropertiesAdminMethods[] = { { STRCAST("addUpdateCallback"), reinterpret_cast<PyCFunction>(nativePropertiesAdminAddUpdateCB), METH_VARARGS, PyDoc_STR(STRCAST("addUpdateCallback(callback) -> None")) }, { STRCAST("removeUpdateCallback"), reinterpret_cast<PyCFunction>(nativePropertiesAdminRemoveUpdateCB), METH_VARARGS, PyDoc_STR(STRCAST("removeUpdateCallback(callback) -> None")) }, + { 0, 0 } /* sentinel */ }; namespace IcePy |