Skip to content

Commit

Permalink
[CoreFoundation] Hopefully fix a Ruby constant lookup issue.
Browse files Browse the repository at this point in the history
A few people have reported an issue where the CFAutoRelease constant
could not be found from the singleton method.

* CocoaPods/CocoaPods#2632
* CocoaPods/CocoaPods#2739

I have been unable to reproduce this, but because the issue has been
reported by more than one person, I'm adding this just to be sure.
  • Loading branch information
alloy committed Oct 28, 2014
1 parent 0cf5c01 commit acfc437
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

* `Project` Make `#==` a fast shallow comparison method, which operates only on
its root object UUID and its path on disk. For full data comparisons, use the
`#eql?` method instead.
`#eql?` method instead.
[Eloy Durán](https://github.com/alloy)
[Xcodeproj#216](https://github.com/CocoaPods/Xcodeproj/pull/216)

Expand All @@ -19,6 +19,15 @@
[Eloy Durán](https://github.com/alloy)
[Xcodeproj#216](https://github.com/CocoaPods/Xcodeproj/pull/216)

###### Bug Fixes

* `CoreFoundation` Hopefully fix a Ruby constant lookup issue. We have been
unable to reproduce this, but since more than one person has reported it,
we're including this fix in the hope it fixes this esoteric issue.
[Eloy Durán](https://github.com/alloy)
[CocoaPods#2632](https://github.com/CocoaPods/CocoaPods/issues/2632)
[CocoaPods#2739](https://github.com/CocoaPods/CocoaPods/issues/2739)


## 0.20.0

Expand Down
5 changes: 4 additions & 1 deletion lib/xcodeproj/plist_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,13 @@ def self.CFTypeDictionaryValueCallBacks
# This pointer will assign `CFRelease` as the free function when
# dereferencing the pointer.
#
# @note This means that the object will *not* be released if it's not
# dereferenced, but that would be a leak anyways, so be sure to do so.
#
def self.CFTypeRefPointer
pointer = Fiddle::Pointer.malloc(Fiddle::SIZEOF_INTPTR_T, free_function)
def pointer.ptr
CFAutoRelease(super)
::CoreFoundation.CFAutoRelease(super)
end
pointer
end
Expand Down

0 comments on commit acfc437

Please sign in to comment.