diff options
author | Renato Filho <renato.filho@openbossa.org> | 2011-09-06 11:04:18 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:54:50 -0300 |
commit | bfcc30ab86727b65c0ab89118e35a45a1e683470 (patch) | |
tree | 4e7cc8d44879ee1d9775a0a9eb0151ada5a58926 | |
parent | d29d9ad5ac54d19aa456d5d8b189766162733445 (diff) |
Fixed problems in function that return None, and was not verified.
Some functions with inject code didnot verify the result value before
convert to Shiboken types.
Fixes bug #998.
Reviewed by: Hugo Parente <hugo.lima@openbossa.org>
Lauro Neto <lauro.neto@openbossa.org>
-rw-r--r-- | PySide/typesystem_templates.xml | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml index c2c0474d7..a35602f72 100644 --- a/PySide/typesystem_templates.xml +++ b/PySide/typesystem_templates.xml @@ -246,10 +246,12 @@ %END_ALLOW_THREADS %PYARG_0 = Shiboken::makeTuple(retval_, %5); </template> - <template name="set_qapp_parent_for_orphan"> - SbkObject* _pySelf = reinterpret_cast<SbkObject*>(%PYARG_0); - if (!Shiboken::Object::hasParentInfo(_pySelf)) - Shiboken::Object::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_0); + <template name="set_qapp_parent_for_orphan"> + if (%PYARG_0 && (%PYARG_0 != Py_None)) { + SbkObject* _pySelf = reinterpret_cast<SbkObject*>(%PYARG_0); + if (!Shiboken::Object::hasParentInfo(_pySelf)) + Shiboken::Object::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_0); + } </template> <!-- templates for __repr__ --> <template name="repr_code"> |