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

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

pitrou commented on a change in pull request #1626: ARROW-2171: [C++/Python] 
Make OwnedRef safer
URL: https://github.com/apache/arrow/pull/1626#discussion_r169120145
 
 

 ##########
 File path: cpp/src/arrow/python/common.h
 ##########
 @@ -98,6 +101,10 @@ class ARROW_EXPORT OwnedRef {
 // (e.g. if it is released in the middle of a function for performance reasons)
 class ARROW_EXPORT OwnedRefNoGIL : public OwnedRef {
  public:
+  OwnedRefNoGIL() : OwnedRef() {}
+  OwnedRefNoGIL(OwnedRefNoGIL&& other) : OwnedRef(other.detach()) {}
+  explicit OwnedRefNoGIL(PyObject* obj) : OwnedRef(obj) {}
 
 Review comment:
   That's what I originally did, but it looks like MSVC doesn't inherit all 
constructors with it:
   
https://ci.appveyor.com/project/ApacheSoftwareFoundation/arrow/build/1.0.5355/job/xy8sve5l9fkyd8qg
   (and related commit: 
https://github.com/apache/arrow/commit/12b680cc8c712a33e2e0e644745a897fc73e6344 
)

----------------------------------------------------------------
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] OwnedRef is fragile
> ----------------------------
>
>                 Key: ARROW-2171
>                 URL: https://issues.apache.org/jira/browse/ARROW-2171
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>    Affects Versions: 0.8.0
>            Reporter: Antoine Pitrou
>            Assignee: Antoine Pitrou
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.9.0
>
>
> Some uses of OwnedRef can implicitly invoke its (default) copy constructor, 
> which will lead to extraneous decrefs.



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

Reply via email to