mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-20 13:19:16 +00:00
NoCopyRendering experiment: Fix possible memory leak if image node rendering is canceled #trivial (#765)
* Fix memory leak if image node rendering is canceled * Update comment
This commit is contained in:
parent
9b8a919a93
commit
c3ae4474d0
@ -522,10 +522,9 @@ static ASDN::StaticMutex& cacheLock = *new ASDN::StaticMutex;
|
|||||||
key.didDisplayNodeContentWithRenderingContext(context, drawParameters);
|
key.didDisplayNodeContentWithRenderingContext(context, drawParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The following `UIGraphicsGetImageFromCurrentImageContext` call will commonly take more than 20ms on an
|
// Check cancellation one last time before forming image.
|
||||||
// A5 processor. Check for cancellation before we call it.
|
|
||||||
if (isCancelled()) {
|
if (isCancelled()) {
|
||||||
UIGraphicsEndImageContext();
|
ASGraphicsEndImageContext();
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,6 +23,9 @@
|
|||||||
*
|
*
|
||||||
* The API mirrors the UIGraphics API, with the exception that forming an image
|
* The API mirrors the UIGraphics API, with the exception that forming an image
|
||||||
* ends the context as well.
|
* ends the context as well.
|
||||||
|
*
|
||||||
|
* Note: You must not mix-and-match between ASGraphics* and UIGraphics* functions
|
||||||
|
* within the same drawing operation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user