mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-03 01:50:55 +00:00
fix premature release
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32453 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f838cc8382
commit
aa9300f786
2 changed files with 11 additions and 12 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2011-03-04 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSOperation.m: retain operation while finishing so that it
|
||||||
|
doesn't get deallocated too soon (when the queue removes it).
|
||||||
|
|
||||||
2011-03-04 Richard Frith-Macdonald <rfm@gnu.org>
|
2011-03-04 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSNumberFormatter.m: Fix -setAllowsFloats to only operate
|
* Source/NSNumberFormatter.m: Fix -setAllowsFloats to only operate
|
||||||
|
|
|
@ -458,18 +458,7 @@ static NSArray *empty = nil;
|
||||||
}
|
}
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
|
|
||||||
[internal->lock lock];
|
|
||||||
NS_DURING
|
|
||||||
{
|
|
||||||
[self _finish];
|
[self _finish];
|
||||||
}
|
|
||||||
NS_HANDLER
|
|
||||||
{
|
|
||||||
[internal->lock unlock];
|
|
||||||
[localException raise];
|
|
||||||
}
|
|
||||||
NS_ENDHANDLER
|
|
||||||
[internal->lock unlock];
|
|
||||||
[pool release];
|
[pool release];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -513,6 +502,10 @@ static NSArray *empty = nil;
|
||||||
@implementation NSOperation (Private)
|
@implementation NSOperation (Private)
|
||||||
- (void) _finish
|
- (void) _finish
|
||||||
{
|
{
|
||||||
|
/* retain while finishing so that we don't get deallocated when our
|
||||||
|
* queue removes and releases us.
|
||||||
|
*/
|
||||||
|
[self retain];
|
||||||
[internal->lock lock];
|
[internal->lock lock];
|
||||||
if (NO == internal->finished)
|
if (NO == internal->finished)
|
||||||
{
|
{
|
||||||
|
@ -533,6 +526,7 @@ static NSArray *empty = nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[internal->lock unlock];
|
[internal->lock unlock];
|
||||||
|
[self release];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue