Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
Depend on NSGraphicsContext to retain/release image contexts -- don't…
Browse files Browse the repository at this point in the history
… confuse the memory management by doing it ourselves
  • Loading branch information
jspahrsummers committed Nov 13, 2011
1 parent 238a895 commit 39a48b3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/UIKit/TUIKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void TUIGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque, CGFloat s
if(size.height < 1) size.height = 1;
CGContextRef ctx = TUICreateGraphicsContextWithOptions(size, opaque);
TUIGraphicsPushContext(ctx);
// will release ctx on pop
CGContextRelease(ctx);
}

void TUIGraphicsBeginImageContext(CGSize size)
Expand All @@ -77,9 +77,7 @@ void TUIGraphicsBeginImageContext(CGSize size)

void TUIGraphicsEndImageContext(void)
{
CGContextRef ctx = TUIGraphicsGetCurrentContext();
TUIGraphicsPopContext();
CGContextRelease(ctx);
}

TUIImage *TUIGraphicsDrawAsImage(CGSize size, void(^draw)(void))
Expand Down

0 comments on commit 39a48b3

Please sign in to comment.