mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
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:
parent
746e70f60f
commit
613717a53f
2 changed files with 25 additions and 1 deletions
|
@ -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:)]
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue