git.samba.org
/
gd
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7e49a58
)
pidl/python: Increment reference counter on Py_None to prevent us from
author
Jelmer Vernooij
<jelmer@samba.org>
Thu, 24 Jun 2010 21:17:51 +0000
(23:17 +0200)
committer
Jelmer Vernooij
<jelmer@samba.org>
Thu, 24 Jun 2010 21:17:51 +0000
(23:17 +0200)
accidentally deallocating it.
pidl/lib/Parse/Pidl/Samba4/Python.pm
patch
|
blob
|
history
diff --git
a/pidl/lib/Parse/Pidl/Samba4/Python.pm
b/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 390ee275103a773cd1a332e32e6e0e940b8f8183..4fb8f6be2c11ff1c3f544750b20384b9b10112ea 100644
(file)
--- a/
pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/
pidl/lib/Parse/Pidl/Samba4/Python.pm
@@
-126,6
+126,7
@@
sub FromUnionToPythonFunction($$$$)
$self->ConvertObjectToPython($mem_ctx, {}, $e, "$name->$e->{NAME}", "ret", "return NULL;");
} else {
$self->pidl("ret = Py_None;");
+ $self->pidl("Py_INCREF(ret);");
}
$self->pidl("return ret;");
@@
-1052,6
+1053,7
@@
sub ConvertObjectToPythonLevel($$$$$$)
$self->pidl("if ($var_name == NULL) {");
$self->indent;
$self->pidl("$py_var = Py_None;");
+ $self->pidl("Py_INCREF($py_var);");
$self->deindent;
$self->pidl("} else {");
$self->indent;