mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
make notification more robust
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32430 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
bf05e6fe8b
commit
f6293dd808
2 changed files with 12 additions and 0 deletions
|
@ -1,4 +1,11 @@
|
|||
2011-03-01 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSKeyValueObserving.m:
|
||||
Retain object while sending notifications so we don't get deallocated
|
||||
during the process.
|
||||
|
||||
2011-03-01 Niels Grewe <niels.grewe@halbordnung.de>
|
||||
|
||||
* Source/GSNetServices.h
|
||||
* Headers/Additions/GNUstepBase/NSNetServices+GNUstepBase.h:
|
||||
Declare a protocol for GNUstep specific delegate methods in
|
||||
|
|
|
@ -991,6 +991,10 @@ replacementForClass(Class c)
|
|||
newValue = null;
|
||||
}
|
||||
|
||||
/* Retain self so that we won't be deallocated during the
|
||||
* notification process.
|
||||
*/
|
||||
[self retain];
|
||||
count = [observations count];
|
||||
while (count-- > 0)
|
||||
{
|
||||
|
@ -1028,6 +1032,7 @@ replacementForClass(Class c)
|
|||
[oldValue release];
|
||||
[change setObject: newValue forKey: NSKeyValueChangeNewKey];
|
||||
[newValue release];
|
||||
[self release];
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
Loading…
Reference in a new issue