jonkeane commented on a change in pull request #10560:
URL: https://github.com/apache/arrow/pull/10560#discussion_r655401085



##########
File path: r/tests/testthat/test-RecordBatch.R
##########
@@ -571,7 +571,7 @@ test_that("RecordBatchReader to C-interface", {
 
   # export the RecordBatchReader via the C-interface
   stream_ptr <- allocate_arrow_array_stream()
-  on.exit(delete_arrow_array_stream(stream_ptr))
+  on.exit(delete_arrow_array_stream(stream_ptr), add = TRUE)

Review comment:
       yes, that's true — I put it here as a reminder that if we move it around 
/ add another one we need to make sure to have it, though it is not strictly 
necessary. 

##########
File path: r/tests/testthat/test-RecordBatch.R
##########
@@ -571,7 +571,7 @@ test_that("RecordBatchReader to C-interface", {
 
   # export the RecordBatchReader via the C-interface
   stream_ptr <- allocate_arrow_array_stream()
-  on.exit(delete_arrow_array_stream(stream_ptr))
+  on.exit(delete_arrow_array_stream(stream_ptr), add = TRUE)

Review comment:
       Aaah good catch, I've moved all of these to calling after we don't need 
the pointer anymore (with a comment). That also calls out _slightly more 
clearly_ that pointer cleanup is *not* part of these functions which is not bad




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

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


Reply via email to