diff options
Diffstat (limited to 'pidl')
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba4/Python.pm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index 390ee27510..4fb8f6be2c 100644 --- 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; |