Source/KlondikeGame.m
changeset 14 4585c74d809c
parent 10 6c78cc6bd7a6
child 16 28392c9a969f
     1.1 --- a/Source/KlondikeGame.m	Thu Jul 03 17:44:30 2008 -0700
     1.2 +++ b/Source/KlondikeGame.m	Tue Jul 08 20:32:52 2008 -0700
     1.3 @@ -59,25 +59,22 @@
     1.4      [Card setCardSize: kCardSize];
     1.5      
     1.6      CGPoint pos = {floor(gap/2)+kCardSize.width/2, floor(boardSize.height-kCardSize.height/2)};
     1.7 -    [_deck release];
     1.8 -    _deck = [[Deck alloc] initWithCardsOfClass: [PlayingCard class]];
     1.9 +    _deck = [[[Deck alloc] initWithCardsOfClass: [PlayingCard class]] autorelease];
    1.10      [_deck shuffle];
    1.11      _deck.position = pos;
    1.12      [_board addSublayer: _deck];
    1.13      
    1.14      pos.x += xSpacing;
    1.15 -    [_sink release];
    1.16 -    _sink = [[Deck alloc] init];
    1.17 +    _sink = [[[Deck alloc] init] autorelease];
    1.18      _sink.position = pos;
    1.19      [_board addSublayer: _sink];
    1.20      
    1.21      pos.x += xSpacing;
    1.22      for( CardSuit suit=kSuitClubs; suit<=kSuitSpades; suit++ ) {
    1.23          pos.x += xSpacing;
    1.24 -        Deck *aces = [[Deck alloc] init];
    1.25 +        Deck *aces = [[[Deck alloc] init] autorelease];
    1.26          aces.position = pos;
    1.27          [_board addSublayer: aces];
    1.28 -        [_aces[suit] release];
    1.29          _aces[suit] = aces;
    1.30      }
    1.31