Author: rfm Date: Mon Apr 3 22:23:31 2017 New Revision: 40433 URL: http://svn.gna.org/viewcvs/gnustep?rev=40433&view=rev Log: fix memory leak
Modified: libs/base/trunk/ChangeLog libs/base/trunk/Source/NSOperation.m Modified: libs/base/trunk/ChangeLog URL: http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/ChangeLog?rev=40433&r1=40432&r2=40433&view=diff ============================================================================== --- libs/base/trunk/ChangeLog (original) +++ libs/base/trunk/ChangeLog Mon Apr 3 22:23:31 2017 @@ -1,3 +1,7 @@ +2017-04-03 Richard Frith-Macdonald <r...@gnu.org> + + * Source/NSOperation.m: Fix leak spotted by David Lobron. + 2017-04-01 Riccardo Mottola <r...@gnu.org> * Source/NSConnection.m @@ -6,7 +10,9 @@ 2017-03-17 Riccardo Mottola <r...@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 <r...@gnu.org> Modified: libs/base/trunk/Source/NSOperation.m URL: http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/NSOperation.m?rev=40433&r1=40432&r2=40433&view=diff ============================================================================== --- libs/base/trunk/Source/NSOperation.m (original) +++ libs/base/trunk/Source/NSOperation.m Mon Apr 3 22:23:31 2017 @@ -292,6 +292,13 @@ { [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 @@ -302,13 +309,6 @@ [internal->lock unlock]; 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) { _______________________________________________ Gnustep-cvs mailing list Gnustep-cvs@gna.org https://mail.gna.org/listinfo/gnustep-cvs