This is an automated email from the ASF dual-hosted git repository.

jdanek pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git


The following commit(s) were added to refs/heads/main by this push:
     new 442af19  PROTON-2511: Fix Fatal Python error: deallocating None (#360)
442af19 is described below

commit 442af1905bbf922d7835a2bbc84133653ca5c3c0
Author: tanzhiying <[email protected]>
AuthorDate: Wed Mar 2 23:22:23 2022 +0800

    PROTON-2511: Fix Fatal Python error: deallocating None (#360)
---
 python/cproton.i | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/python/cproton.i b/python/cproton.i
index dff38ff..f12271d 100644
--- a/python/cproton.i
+++ b/python/cproton.i
@@ -238,6 +238,7 @@ PN_HANDLE(PNI_PYTRACER);
 %typemap(out) pn_msgid_t {
   switch ($1.type) {
     case PN_NULL:
+      Py_INCREF(Py_None);
       $result = Py_None;
       break;
     case PN_ULONG:
@@ -261,6 +262,7 @@ PN_HANDLE(PNI_PYTRACER);
         $result = PyLong_FromLong(v);
         break;
       }
+      Py_INCREF(Py_None);
       $result = Py_None;
       break;
     }
@@ -272,6 +274,7 @@ PN_HANDLE(PNI_PYTRACER);
       }
     }
     default:
+      Py_INCREF(Py_None);
       $result = Py_None;
       break;
   }

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to