Memory leak in SKTextureAtlas preloadWithCompletionHandler using XCODE 8.0

Hope someone can help me find the answer to this problem. I filed a bug report in an apple a few weeks ago (28684035), but they have not yet responded to my report. The apple forum doesn't help either. My game is under development, and sometimes it crashes when loading, when everything I do calls the SKTextureAtlas method preloadWithCompletionHandler.

See below for more details. If you have any questions regarding the problem, feel free to post.

Summary: I created a test project and simply added the following code to touchUpAtPoint:

SKTextureAtlas* atlas = [SKTextureAtlas atlasNamed:@"GlobalMap"];

 [atlas preloadWithCompletionHandler:^{ 

}];

I looked at the tools and it detects memory leaks whenever this method is called. In the end, he falls. I discovered this leak because in my current game project I preloaded several of my atlases at the beginning of the game. It started crashing when I upgraded my code to XCODE 8.0 and my iPhone to iOS 10.0

Playback steps:

  • Create a test project
  • Add atlas to the project
  • Add preloadWithCompletionHandler code.
  • Launching the application and tracking memory and memory leak in Tools
  • Touch the screen several times (or even once - you will see some leaks).

Version: iOS 10.0.2 Configuration: iPhone 6

+5
source share

Source: https://habr.com/ru/post/1258967/


All Articles