summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-09-06 11:04:18 -0300
committerRenato Filho <renato.filho@openbossa.org>2011-09-06 15:05:18 -0300
commit18f860962c9e844fa6fe1e1e8d1e53dd5265fa46 (patch)
tree21b1f48a8eff5759a9994ed65cc8ee881bd6b7a3
parentb7a557264433e101bb69f3da60ef15507c60052d (diff)
downloadpyside-18f860962c9e844fa6fe1e1e8d1e53dd5265fa46.tar.gz
pyside-18f860962c9e844fa6fe1e1e8d1e53dd5265fa46.tar.xz
pyside-18f860962c9e844fa6fe1e1e8d1e53dd5265fa46.zip
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.xml10
1 files changed, 6 insertions, 4 deletions
diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml
index c2c0474..a35602f 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&lt;SbkObject*&gt;(%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 &amp;&amp; (%PYARG_0 != Py_None)) {
+ SbkObject* _pySelf = reinterpret_cast&lt;SbkObject*&gt;(%PYARG_0);
+ if (!Shiboken::Object::hasParentInfo(_pySelf))
+ Shiboken::Object::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_0);
+ }
</template>
<!-- templates for __repr__ -->
<template name="repr_code">