- axmol version: 2.11.3
- developing environments
I have been getting many crashes from my users. I've attached 2 photos of their stack trace. It does not seem to originate in my code.
I have not been able to reproduce the crash but Claude pinpointed a cause with a simple fix so I wanted to share it with you and see if it should be included. I've also added an image of what Claude changed.
Here are Claude's remarks:
Root cause: _initWithString in Device-ios.mm creates UIFont, NSAttributedString, and other ObjC objects with no surrounding @autoreleasepool. These objects drain lazily with the main run loop's pool, leaving CoreText's CGFontStrike cache with dangling pointers. When _applicationDidEnterBackground fires CTFontRemoveFromCaches, it follows the corrupted pointer and crashes at 0x2 in block_free.
Fix (two changes in _initWithString):
- Wrap the function body in @autoreleasepool {} so all ObjC font objects are released immediately after rendering
- Fix the NSString* str leak — [[NSString alloc] initWithBytes:...] was never released; changed to [[[NSString alloc] ...] autorelease]
Evidence: 700+ unique device crashes across iOS 18 and iOS 26, back to at least app version 3.1, all with identical stack signature (CGFontStrikeRelease → CGFontCacheRemoveFont → CTFontRemoveFromCaches → _applicationDidEnterBackground).

I have been getting many crashes from my users. I've attached 2 photos of their stack trace. It does not seem to originate in my code.
I have not been able to reproduce the crash but Claude pinpointed a cause with a simple fix so I wanted to share it with you and see if it should be included. I've also added an image of what Claude changed.
Here are Claude's remarks:
Root cause: _initWithString in Device-ios.mm creates UIFont, NSAttributedString, and other ObjC objects with no surrounding @autoreleasepool. These objects drain lazily with the main run loop's pool, leaving CoreText's CGFontStrike cache with dangling pointers. When _applicationDidEnterBackground fires CTFontRemoveFromCaches, it follows the corrupted pointer and crashes at 0x2 in block_free.
Fix (two changes in _initWithString):
Evidence: 700+ unique device crashes across iOS 18 and iOS 26, back to at least app version 3.1, all with identical stack signature (CGFontStrikeRelease → CGFontCacheRemoveFont → CTFontRemoveFromCaches → _applicationDidEnterBackground).