summaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2012-05-05 21:18:32 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2012-05-05 21:18:32 (GMT)
commite6d904800420ff67703f935184369450b4dfd086 (patch)
tree15dffbb9cf5981df8b5eb3ffcc32f5b0831f3b3a /bindings
parent1473b92b8636bf9f7325ef304a627e5258fbc659 (diff)
downloadlasso-e6d904800420ff67703f935184369450b4dfd086.zip
lasso-e6d904800420ff67703f935184369450b4dfd086.tar.gz
lasso-e6d904800420ff67703f935184369450b4dfd086.tar.bz2
[bindings/python] in constructors wrappers build the return value before
Diffstat (limited to 'bindings')
-rw-r--r--bindings/python/lang.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/bindings/python/lang.py b/bindings/python/lang.py
index d38c37b..4c3d7cc 100644
--- a/bindings/python/lang.py
+++ b/bindings/python/lang.py
@@ -982,6 +982,17 @@ register_constants(PyObject *d)
print >> fd, ' ',
print >> fd, '%s(%s);' % (m.name, ', '.join([ref_name(x) for x in m.args]))
+ if m.return_type:
+ # Constructor so decrease refcount (it was incremented by PyGObjectPtr_New called
+ # in self.return_value
+ try:
+ self.return_value(fd, m.return_arg)
+ except:
+ print >>sys.stderr, 'W: cannot assign return value of', m
+ raise
+
+ if is_transfer_full(m.return_arg, default=True):
+ self.free_value(fd, m.return_arg, name = 'return_value')
for f, arg in zip(parse_tuple_format, m.args):
if is_out(arg):
self.return_value(fd, arg, return_var_name = arg[1], return_pyvar_name = 'out_pyvalue')
@@ -1002,16 +1013,6 @@ register_constants(PyObject *d)
if not m.return_type:
print >> fd, ' return noneRef();'
else:
- # Constructor so decrease refcount (it was incremented by PyGObjectPtr_New called
- # in self.return_value
- try:
- self.return_value(fd, m.return_arg)
- except:
- print >>sys.stderr, 'W: cannot assign return value of', m
- raise
-
- if is_transfer_full(m.return_arg):
- self.free_value(fd, m.return_arg, name = 'return_value')
print >> fd, ' return return_pyvalue;'
print >> fd, '}'
print >> fd, ''