mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-06 06:30:46 +00:00
Retain/rele4ase fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13899 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e299ba5d37
commit
246913a1db
2 changed files with 27 additions and 4 deletions
|
@ -1,3 +1,10 @@
|
|||
2002-06-17 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSTimer.m: Retain target and user info on initialisation
|
||||
Release them on invalidation. Ensure timer is invalidated on
|
||||
deallocation.
|
||||
Changes based on bug report by Andy Ruder <aeruder@yahoo.com>
|
||||
|
||||
2002-06-16 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSFTPURLHandle.m: simple implementation added
|
||||
|
|
|
@ -63,9 +63,9 @@ static Class NSDate_class;
|
|||
_interval = ti;
|
||||
_date = [[NSDate_class allocWithZone: [self zone]]
|
||||
initWithTimeIntervalSinceNow: ti];
|
||||
_target = object;
|
||||
_target = RETAIN(object);
|
||||
_selector = selector;
|
||||
_info = info;
|
||||
_info = RETAIN(info);
|
||||
_repeats = f;
|
||||
return self;
|
||||
}
|
||||
|
@ -122,6 +122,10 @@ static Class NSDate_class;
|
|||
|
||||
- (void) dealloc
|
||||
{
|
||||
if (_invalidated == NO)
|
||||
{
|
||||
[self invalidate];
|
||||
}
|
||||
RELEASE(_date);
|
||||
[super dealloc];
|
||||
}
|
||||
|
@ -166,6 +170,14 @@ static Class NSDate_class;
|
|||
|
||||
- (void) invalidate
|
||||
{
|
||||
if (_target != nil)
|
||||
{
|
||||
DESTROY(_target);
|
||||
}
|
||||
if (_info != nil)
|
||||
{
|
||||
DESTROY(_info);
|
||||
}
|
||||
/* OPENSTEP allows this method to be called multiple times. */
|
||||
//NSAssert(_invalidated == NO, NSInternalInconsistencyException);
|
||||
_invalidated = YES;
|
||||
|
@ -174,9 +186,13 @@ static Class NSDate_class;
|
|||
- (BOOL) isValid
|
||||
{
|
||||
if (_invalidated == NO)
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSDate*) fireDate
|
||||
|
|
Loading…
Reference in a new issue