remove as observer on dealloc

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/stable@33258 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-06-07 18:36:12 +00:00
parent 746e70f60f
commit 613717a53f
2 changed files with 25 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2011-06-07 Richard Frith-Macdonald <rfm@gnu.org>
* Source/Additions/GSLock.m:
Remove notification observation on dealloc.
2011-06-03 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSString.m: [(-getLineStart:end:contentsEnd:forRange:)]

View file

@ -72,11 +72,19 @@
locked = -1;
}
#ifdef __GS_WITH_GC__
- (void) finalize
{
[[NSNotificationCenter defaultCenter] removeObserver: self];
[super finalize];
}
#else
- (void) dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver: self];
[super dealloc];
}
#endif
- (id) init
{
@ -214,11 +222,22 @@
counter = -1;
}
#ifdef __GS_WITH_GC__
- (void) finalize
{
[[NSNotificationCenter defaultCenter] removeObserver: self];
if (counter >= 0)
{
[[NSNotificationCenter defaultCenter] removeObserver: self];
}
[super finalize];
}
#else
- (void) dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver: self];
[super dealloc];
}
#endif
- (id) init
{