[ 
https://issues.apache.org/jira/browse/ARROW-2270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16388410#comment-16388410
 ] 

ASF GitHub Bot commented on ARROW-2270:
---------------------------------------

xhochy commented on a change in pull request #1714: ARROW-2270: [Python] Fix 
lifetime of ForeignBuffer base object
URL: https://github.com/apache/arrow/pull/1714#discussion_r172636367
 
 

 ##########
 File path: cpp/src/arrow/python/io.cc
 ##########
 @@ -216,5 +216,19 @@ Status PyOutputStream::Write(const void* data, int64_t 
nbytes) {
   return file_->Write(data, nbytes);
 }
 
+// ----------------------------------------------------------------------
+// Foreign buffer
+
+Status PyForeignBuffer::Make(const uint8_t* data, int64_t size, PyObject* base,
 
 Review comment:
   Can you add the description of the JIRA ticket somewhere in the code? I was 
not aware what went wrong in the initial implementation only from reading the 
change but I needed the context of the JIRA issue.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [Python] ForeignBuffer doesn't tie Python object lifetime to C++ buffer 
> lifetime
> --------------------------------------------------------------------------------
>
>                 Key: ARROW-2270
>                 URL: https://issues.apache.org/jira/browse/ARROW-2270
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>            Reporter: Antoine Pitrou
>            Assignee: Antoine Pitrou
>            Priority: Major
>              Labels: pull-request-available
>
> {{ForeignBuffer}} keeps the reference to the Python base object in the Python 
> wrapper class, not in the C++ buffer instance, meaning if the C++ buffer gets 
> passed around but the Python wrapper gets destroyed, the reference to the 
> original Python base object will be released.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to