ARC が有効bufferReady
になっており、C++ ライブラリ (非 ARC が有効) によってトリガーされています。どこかで ARC キャストが欠落していると確信しています。お知らせ下さい。前もって感謝します。
以下のコードで:
@implementation HelloWorldLayer
id refToSelf; //reference to self
int shakeCounter = 0;
void bufferReady() {
if (shakeCounter % 100 == 0) {
[refToSelf shakes];
}
shakeCounter++;
}
- (void) shakes {
CCRotateBy * rotate = [CCRotateBy actionWithDuration:0.1 angle:2];
CCActionInterval * rotateReverse = [rotate reverse];
CCSequence * seq1 = [CCSequence actions:rotate, rotateReverse, nil];
CCMoveBy * shake = [CCMoveBy actionWithDuration:0.1 position:ccp(5, 0)];
CCActionInterval * shakeReverse = [shake reverse];
CCSequence * seq2 = [CCSequence actions:shake, shakeReverse, nil];
CCSpawn * spawner = [CCSpawn actions:seq1, seq2, nil];
CCSequence * lastSequence = [CCSequence actions:spawner, spawner, spawner, spawner, nil];
[self runAction:lastSequence];
}
- (id) init {
if((self = [super init])) {
...
}
refToSelf = self;
return self;
}
実行時に、実行されるたびにメモリ リークの警告が表示shakes
されます。
objc[10060]: Object 0x466830 of class CCRotateBy autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
objc[10060]: Object 0x44cb70 of class CCRotateBy autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
objc[10060]: Object 0x46b260 of class CCSequence autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
objc[10060]: Object 0x45a790 of class CCMoveBy autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
objc[10060]: Object 0x469150 of class CCMoveBy autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
objc[10060]: Object 0x469190 of class CCSequence autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
objc[10060]: Object 0x46b350 of class CCSpawn autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
objc[10060]: Object 0x46b380 of class CCSequence autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
objc[10060]: Object 0x46b3b0 of class CCSequence autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
objc[10060]: Object 0x46bc00 of class CCSequence autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug