From 80276abfa165b36e06aef0293cd4cf388b253e57 Mon Sep 17 00:00:00 2001 From: Niels Grewe Date: Tue, 28 Apr 2015 13:28:01 +0000 Subject: [PATCH] Use -autorelease rather than -release when returning objects from a FIFO. Fixes a bug where a returned reference would already be invalid because the FIFO was the last owner of the object git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/performance/trunk@38462 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ GSFIFO.m | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index be68873..23cc1ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-04-28 Niels Grewe + + * GSFIFO.m: Use -autorelease rather than -release when returning + objects from a FIFO. Fixes a bug where a returned reference would + already be invalid because the FIFO was the last owner of the object. + 2015-01-09 Richard Frith-Macdonald * GSFIFO.[hm]: add methods for working with objects and handling diff --git a/GSFIFO.m b/GSFIFO.m index 881b238..4453d91 100644 --- a/GSFIFO.m +++ b/GSFIFO.m @@ -406,7 +406,7 @@ stats(NSTimeInterval ti, uint32_t max, NSTimeInterval *bounds, uint64_t *bands) index = result = [self get: (void**)buf count: count shouldBlock: block]; while (index-- > 0) { - [buf[index] release]; + [buf[index] autorelease]; } return result; }