Ignore:
Timestamp:
11/23/07 23:50:00 (16 years ago)
Author:
Nicholas Riley
Message:

PSAlarms.m: Fix leak of restored alarms.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cocoa/Pester/Source/PSAlarms.m

    r355 r357  
    274274        e = [plPendingAlarms objectEnumerator];
    275275        while ( (plAlarm = [e nextObject]) != nil) {
    276             [alarms addObject: [[PSAlarm alloc] initWithPropertyList: plAlarm]];
     276            alarm = [[PSAlarm alloc] initWithPropertyList: plAlarm];
     277            [alarms addObject: alarm];
     278            [alarm release];
    277279        }
    278280
     
    280282        while ( (plAlarm = [e nextObject]) != nil) {
    281283            // expired alarms may be ready for deletion, or may repeat - if the latter, PSAlarm will reschedule the alarm so the repeat interval begins at restoration time.
    282             if ( (alarm = [[PSAlarm alloc] initWithPropertyList: plAlarm]) != nil)
     284            if ( (alarm = [[PSAlarm alloc] initWithPropertyList: plAlarm]) != nil) {
    283285                [alarms addObject: alarm];
     286                [alarm release];
     287            }
    284288        }
    285289        expiredAlarms = [[NSMutableSet alloc] init];
Note: See TracChangeset for help on using the changeset viewer.