fix memory leak

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40433 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2017-04-03 20:23:31 +00:00
parent b5b9126290
commit c6b8f4fb03
2 changed files with 14 additions and 8 deletions

View file

@ -1,3 +1,7 @@
2017-04-03 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSOperation.m: Fix leak spotted by David Lobron.
2017-04-01 Riccardo Mottola <rm@gnu.org>
* Source/NSConnection.m
@ -6,7 +10,9 @@
2017-03-17 Riccardo Mottola <rm@gnu.org>
* Source/NSFileManager.m:(nextObject of Enumerator)
Skip file if no valid filename could be retrieved most probably due to Charset mismatches, this is is more a last resort: probably a lossy conversion should be attempted before.
Skip file if no valid filename could be retrieved most probably due
to Charset mismatches, this is is more a last resort: probably a
lossy conversion should be attempted before.
2017-03-17 Richard Frith-Macdonald <rfm@gnu.org>

View file

@ -292,6 +292,13 @@ static NSArray *empty = nil;
{
[internal->lock lock];
/* We only observe isFinished changes, and we can remove self as an
* observer once we know the operation has finished since it can never
* become unfinished.
*/
[object removeObserver: self
forKeyPath: @"isFinished"];
if (object == self)
{
/* We have finished and need to unlock the condition lock so that
@ -303,13 +310,6 @@ static NSArray *empty = nil;
return;
}
/* We only observe isFinished changes, and we can remove self as an
* observer once we know the operation has finished since it can never
* become unfinished.
*/
[object removeObserver: self
forKeyPath: @"isFinished"];
if (NO == internal->ready)
{
NSEnumerator *en;