pitrou commented on code in PR #702:
URL: https://github.com/apache/arrow-adbc/pull/702#discussion_r1204556304


##########
python/adbc_driver_manager/adbc_driver_manager/_lib.pyx:
##########
@@ -498,6 +511,11 @@ cdef class ArrowArrayStreamHandle:
         """The address of the ArrowArrayStream."""
         return <uintptr_t> &self.stream
 
+    def _to_capsule(self):
+        return cpython.PyCapsule_New(
+            &self.stream, 'arrowarraystream', pycapsule_stream_deleter

Review Comment:
   This will not keep `self` alive and therefore the capsule pointer may become 
unreachable.
   
   I think the capsule needs to own a malloc'ed ArrowArrayStream pointer. 
@lidavidm Thoughts?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to