File tree 2 files changed +8
-11
lines changed
2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -313,6 +313,8 @@ afCall1' op =
313
313
throwAFError =<< op ptrInput
314
314
peek ptrInput
315
315
316
+ -- | Note: We don't add a finalizer to 'Array' since the 'Features' finalizer frees 'Array'
317
+ -- under the hood.
316
318
featuresToArray
317
319
:: Features
318
320
-> (Ptr AFArray -> AFFeatures -> IO AFErr )
@@ -324,8 +326,7 @@ featuresToArray (Features fptr1) op =
324
326
alloca $ \ ptrInput -> do
325
327
throwAFError =<< op ptrInput ptr1
326
328
Array <$> do
327
- newForeignPtr af_release_array_finalizer
328
- =<< peek ptrInput
329
+ newForeignPtr_ =<< peek ptrInput
329
330
330
331
infoFromFeatures
331
332
:: Storable a
@@ -439,4 +440,4 @@ infoFromArray4 (Array fptr1) op =
439
440
(,,,) <$> peek ptrInput1
440
441
<*> peek ptrInput2
441
442
<*> peek ptrInput3
442
- <*> peek ptrInput4
443
+ <*> peek ptrInput4
Original file line number Diff line number Diff line change @@ -10,12 +10,8 @@ spec =
10
10
it " Should get features number an array" $ do
11
11
let feats = createFeatures 10
12
12
getFeaturesNum feats `shouldBe` 10
13
- -- it "Should retain features" $ do
14
- -- let feats = createFeatures 100
15
- -- retainFeatures feats
16
- -- print (getFeaturesSize feats)
17
- -- print (getFeaturesOrientation feats)
18
- -- print (getFeaturesXPos feats)
19
- -- print (getFeaturesXPos feats)
20
- -- scalar @Int 10 `shouldBe` scalar @Int 10
13
+ -- print (getFeaturesSize feats)
14
+ -- print (getFeaturesOrientation feats)
15
+ -- print (getFeaturesXPos feats)
16
+ -- print (getFeaturesYPos feats)
21
17
You can’t perform that action at this time.
0 commit comments