gnustep / libobjc2

Objective-C runtime library intended for use with Clang.
http://www.gnustep.org/
MIT License
426 stars 116 forks source link

Fix retain calls in dealloc methods to return the instance pointer as expected #204

Closed Graham--M closed 3 years ago

Graham--M commented 3 years ago

This addresses a regression in 73132a6 (#200) where retains of an object inside its dealloc method no longer return a pointer to the instance and this behaviour prevents blocks inside a dealloc from capturing the self pointer via objc_storeStrong().

The objc_retain(id value) method is defined in the Clang ARC ABI supplement to always return the value passed into it.

triplef commented 3 years ago

Thanks for fixing this @Graham--M!