MichaelHackett / Kiwi

BDD for iOS
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Blocks should be copied when saved by test spies #7

Closed MichaelHackett closed 10 years ago

MichaelHackett commented 10 years ago

Currently, when a KWSpy receives a message, it makes a copy of the NSInvocation object and retains the parameters. In the case of a block object that is on the stack, however, retaining it is not enough. This causes a crash when the NSInvocation is later deallocated (when the spy is deallocated) and the runtime attempts to release the block object that was retained. By this time, a stack-allocated block will have been overwritten, and the release will be sent to an invalid object.

MichaelHackett commented 10 years ago

Resolved by 35728bad91.