corefoundation 0.3.10 → 0.3.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d15b6c04c11822ecb99313727fd447e77dbbe1b54edc855eb279624a4a188b96
4
- data.tar.gz: d039784d1c63c0f19dcee35315e89daedb685a46f27e0ef31a511b38f7a783ca
3
+ metadata.gz: b4052eded27a6188c93ee482a6d7dfa3d3bf5bcdacbbe9a9801ad1dd86c28790
4
+ data.tar.gz: 2d6dab3b3d788a0671acfd36781739d763014db6c3a864ea64437ed12719e5bc
5
5
  SHA512:
6
- metadata.gz: b4f12101f8247a236e4847b0ab3eb92d06b7efcf4f5a10f8a05dc038b30f382297244514906744ae1adb02cf25ea7a9a184aa24478c94c84bda40f00cae5334f
7
- data.tar.gz: 99fc2e0c51b8e93b8596920a370303c1a08ec33cfcdeb496e1092d0384c652310f72b7301471e72c2f089edbb5bbf142a720dbc0d859772256b003f8be00f304
6
+ metadata.gz: '09ed7185a6cd6046bed44eef079013b5b15a5df17d70c01ac13aa17dcbcae01df39afb5868e40d70409cdd46136cdc2e92d829503a05341ef2b609f5e29cf84a'
7
+ data.tar.gz: c62e84155e57619823cccc52b9b6ff34cef39d2e657500505bb72b192da809bab178127c70040b6b284dd138bb02377a461d2de65925775d65bc576b87ca7753
@@ -49,7 +49,7 @@ module CF
49
49
  range[:location] = 0
50
50
  range[:length] = length
51
51
  callback = lambda do |value, _|
52
- yield Base.typecast(value).retain
52
+ yield Base.typecast(value)
53
53
  end
54
54
  CF.CFArrayApplyFunction(self, range, callback, nil)
55
55
  self
@@ -79,7 +79,7 @@ module CF
79
79
  # @param [Integer] index the 0 based index of the item to retrieve. Behaviour is undefined if it is not in the range 0...size
80
80
  # @return [CF::Base] a subclass of CF::Base
81
81
  def [](index)
82
- Base.typecast(CF.CFArrayGetValueAtIndex(self, index)).retain
82
+ Base.typecast(CF.CFArrayGetValueAtIndex(self, index))
83
83
  end
84
84
 
85
85
  # Sets object at the index
@@ -33,11 +33,12 @@ module CF
33
33
  def initialize(pointer)
34
34
  @ptr = FFI::Pointer.new(pointer)
35
35
  ObjectSpace.define_finalizer(self, self.class.finalize(ptr))
36
+ CF.retain(ptr)
36
37
  end
37
38
 
38
39
  # @param [FFI::Pointer] pointer to the address of the object
39
40
  def self.finalize(pointer)
40
- proc { CF.release(pointer.address) unless pointer.address.zero? }
41
+ proc { CF.release(pointer) unless pointer.address.zero? }
41
42
  end
42
43
 
43
44
  # Whether the instance is the CFNull singleton
@@ -55,7 +55,7 @@ module CF
55
55
 
56
56
  def each
57
57
  callback = lambda do |key, value, _|
58
- yield [Base.typecast(key).retain, Base.typecast(value).retain]
58
+ yield [Base.typecast(key), Base.typecast(value)]
59
59
  end
60
60
  CF.CFDictionaryApplyFunction(self, callback, nil)
61
61
  self
@@ -70,7 +70,7 @@ module CF
70
70
  key = CF::String.from_string(key) if key.is_a?(::String)
71
71
  self.class.check_cftype(key)
72
72
  raw = CF.CFDictionaryGetValue(self, key)
73
- raw.null? ? nil : self.class.typecast(raw).retain
73
+ raw.null? ? nil : self.class.typecast(raw)
74
74
  end
75
75
 
76
76
  # Sets the value associated with the key, or nil
@@ -1,4 +1,4 @@
1
1
  module CF
2
2
  # The current version string
3
- VERSION = "0.3.10"
3
+ VERSION = "0.3.13"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: corefoundation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.10
4
+ version: 0.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frederick Cheung
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-01-13 00:00:00.000000000 Z
12
+ date: 2022-02-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
@@ -59,14 +59,14 @@ dependencies:
59
59
  requirements:
60
60
  - - '='
61
61
  - !ruby/object:Gem::Version
62
- version: 2.2.0
62
+ version: 2.2.1
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - '='
68
68
  - !ruby/object:Gem::Version
69
- version: 2.2.0
69
+ version: 2.2.1
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: yard
72
72
  requirement: !ruby/object:Gem::Requirement