summaryrefslogtreecommitdiff
path: root/py/modules/IcePy/PropertiesAdmin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'py/modules/IcePy/PropertiesAdmin.cpp')
-rw-r--r--py/modules/IcePy/PropertiesAdmin.cpp10
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