pitrou commented on code in PR #12590:
URL: https://github.com/apache/arrow/pull/12590#discussion_r855151417


##########
cpp/src/arrow/python/common.h:
##########
@@ -180,6 +180,9 @@ class ARROW_PYTHON_EXPORT OwnedRefNoGIL : public OwnedRef {
   explicit OwnedRefNoGIL(PyObject* obj) : OwnedRef(obj) {}
 
   ~OwnedRefNoGIL() {
+    if (obj() == NULLPTR) {

Review Comment:
   This probably deserves an explanatory comment.
   ```suggestion
       // This destructor may be called after the Python interpreter is 
finalized.
       // At least avoid spurious attempts to take the GIL when not necessary.
       if (obj() == NULLPTR) {
   ```



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