og-corefoundation 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -0
- data/lib/corefoundation/base.rb +6 -4
- data/lib/corefoundation/version.rb +1 -1
- data/spec/spec_helper.rb +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec701eb276e895b898552abc364e9dc8eebe76a5d51d84011b1b5406751ef3b6
|
4
|
+
data.tar.gz: ad3d0ba5ceaed6c72abf68dcb21f9d22ddf7a03cfadd32317fd5bf81fbefe673
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa6df27f22f95f28ce8ebb21b2613f38328345c5f6c8ee8000479ff7f41284e032fea268e31234e76d928a5ba7e2d53c4e1bcc3c64d12454cf2db6fe9d876e00
|
7
|
+
data.tar.gz: 4284c22b9cc4ab964056155dd19889e53eb8e9f3cf1f72302043670fe1bbf91b662f0625f73ded8115255374fac4d50d3ba4f2a9da4c6b18b6e2f79dd5b67422
|
data/CHANGELOG
CHANGED
data/lib/corefoundation/base.rb
CHANGED
@@ -47,13 +47,15 @@ module CF
|
|
47
47
|
# @private
|
48
48
|
class Releaser
|
49
49
|
def initialize(ptr)
|
50
|
-
|
50
|
+
# this creates a pointer that has the same value
|
51
|
+
# without creating a gc reference to the original ptr
|
52
|
+
@ptr = FFI::MemoryPointer.new(:pointer).write_pointer(ptr).read_pointer
|
51
53
|
end
|
52
54
|
|
53
55
|
def call *ignored
|
54
|
-
if @
|
55
|
-
CF.release(
|
56
|
-
@
|
56
|
+
if @ptr && !@ptr.null?
|
57
|
+
CF.release(@ptr)
|
58
|
+
@ptr = nil
|
57
59
|
end
|
58
60
|
end
|
59
61
|
end
|
data/spec/spec_helper.rb
CHANGED