summaryrefslogtreecommitdiffstats
path: root/libshiboken/conversions.h
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-03-23 12:47:33 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-03-23 13:01:04 -0300
commit26c960fc8e893a4edc655d8548a5ec56f7262bc4 (patch)
tree8a8ebe14958eb4b5bbb1992ceeab25bcd37438f5 /libshiboken/conversions.h
parenta38c294732542b8d25ca1a34856c2ffa4fa2b1ac (diff)
downloadshiboken-26c960fc8e893a4edc655d8548a5ec56f7262bc4.tar.gz
shiboken-26c960fc8e893a4edc655d8548a5ec56f7262bc4.tar.xz
shiboken-26c960fc8e893a4edc655d8548a5ec56f7262bc4.zip
Fixes Converter<void*>::toPython method.
The void* converter transforms a C++ NULL pointer in a Python None. An unit test for this case was added as well. Reviewed by Anderson Lizardo <anderson.lizardo@openbossa.org> Reviewed by Bruno Ara├║jo <bruno.araujo@openbossa.org>
Diffstat (limited to 'libshiboken/conversions.h')
-rw-r--r--libshiboken/conversions.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libshiboken/conversions.h b/libshiboken/conversions.h
index 541e026b..35f22d38 100644
--- a/libshiboken/conversions.h
+++ b/libshiboken/conversions.h
@@ -179,6 +179,8 @@ struct Converter<void*>
static inline bool isConvertible(PyObject* pyobj) { return true; }
static PyObject* toPython(const void* cppobj)
{
+ if (!cppobj)
+ Py_RETURN_NONE;
PyObject* pyobj = BindingManager::instance().retrieveWrapper(cppobj);
if (pyobj)
Py_INCREF(pyobj);