mirror of
https://github.com/SFML/SFML.git
synced 2025-02-19 06:39:59 +08:00
GUI toolkits such as wxWidgets and Qt provide their own NSAutoreleasePool objects. To avoid pool corruption, it is required that the pools be nested, which the previous implementation did not guarantee. Furthermore, autorelease pools should always be drained in the same context (function, loop, etc.) that they are created, which was not the case with the previous implementation (https://developer.apple.com/documentation/foundation/nsautoreleasepool). This commit removes long-lived autorelease pools, and instead each function that calls into the Cocoa API creates its own autorelease pool (using the new C++ AutoreleasePool wrapper object). Should fix crashes in issue #1549 and similar.