OpenGL ES アクティビティがあり、何らかの理由で、ほぼすべての行にコメントした後でもメモリ リークが発生します。残りのコードです
.h ファイル
#import <UIKit/UIKit.h>
#import <GLKit/GLKit.h>
@interface PlayMain : GLKViewController <UIAccelerometerDelegate>{ }
@end
.m ファイル
@interface PlayMain ()
{
}
@property (strong, nonatomic) EAGLContext *context;
@property (strong, nonatomic) GLKBaseEffect *effect;
@end
@implementation PlayMain{}
@synthesize context = _context;
@synthesize effect = _effect;
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1];
if (!self.context)
{
NSLog(@"Failed to create ES context");
}
GLKView *view = (GLKView *)self.view;
view.context = self.context;
view.drawableDepthFormat = GLKViewDrawableDepthFormat24;
[EAGLContext setCurrentContext:self.context];
}
- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect
{
}
openGL アクティビティと別のアクティビティの間で約 10 ~ 20 回の切り替え (3 つのラベルと、openGL アクティビティに戻るセグエを作成する 1 つのボタンが含まれています) の後、アプリはメモリ警告を受け取ります。続行すると、さらに数回切り替えた後、プロセスが終了します。何か不足していますか?
また、テストしているデバイスは ipod4 で、プロジェクト設定で ARC を使用しています。