Skip to content

Commit 4f3e10c

Browse files
committed
Merge branch 'develop-v3' of github:cocos2d/cocos2d-iphone into develop-v3
Former-commit-id: a466a06
2 parents 8594c79 + 9a97ddf commit 4f3e10c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cocos2d/CCActionManager.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ -(void) deleteHashElement:(tHashElement*)element
8181

8282
-(void) actionAllocWithHashElement:(tHashElement*)element
8383
{
84-
NSMutableArray* aObj = [[NSMutableArray alloc] init];
85-
void* a = (__bridge void*) aObj;
86-
CFRetain(a);
87-
88-
// 4 actions per Node by default
89-
if( element->actions == nil )
84+
// if actions array doesn't exist yet, create one
85+
if( element->actions == nil ) {
86+
NSMutableArray* aObj = [[NSMutableArray alloc] init];
87+
void* a = (__bridge void*) aObj;
88+
CFRetain(a);
9089
element->actions = aObj;
90+
}
9191
}
9292

9393
-(void) removeActionAtIndex:(NSUInteger)index hashElement:(tHashElement*)element

0 commit comments

Comments
 (0)