1

I'm testing my Objective C project for memory leaks using xCode Instruments tool.

The following lines (in my procedure to find matches in Game Center) are generating a Memory Leak:

GKMatchRequest *request = [[GKMatchRequest alloc] init];
request.minPlayers = minPlayers;
request.maxPlayers = maxPlayers;
GKMatchmakerViewController *mmvc = [[GKMatchmakerViewController alloc] initWithMatchRequest:request];

According to the Instruments Stack Trace, the Leaked Object is "GKMatchRequest".

Responsible Library: GameCenterFoundation

Responsible Frame: -[GKMatchRequest copyWithZone:]

Instruments Tool - Memory Leaks

I'm using ARC, so it should not be required to include 'Autorelease' right after the 'request' as suggested in some forums reporting a similar issue (i.e.: https://forums.coronalabs.com/topic/59315-ios-native-plugin-objective-c-memory-leak/).

How to avoid this memory leak in my code ?

Pablo Alfonso
  • 2,317
  • 1
  • 18
  • 24

0 Answers0