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


##########
python/adbc_driver_manager/adbc_driver_manager/_lib.pyx:
##########
@@ -460,6 +461,18 @@ cdef class _AdbcHandle:
                     f"with open {self._child_type}")
 
 
+cdef void pycapsule_stream_deleter(object stream_capsule):
+    cdef:
+        CArrowArrayStream* stream
+    # Do not invoke the deleter on a used/moved capsule
+    stream = <CArrowArrayStream*>cpython.PyCapsule_GetPointer(
+        stream_capsule, 'arrowarraystream'
+    )

Review Comment:
   That is pretty tricky though. PyCapsule_GetPointer will set the global 
python error but I'm not sure how you'd know to check for that after this is 
executed; so this could potentially be a pitfall of segfaults or leaked pointers



-- 
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