UICFFont autoreleased with no pool in place?
-
09-10-2019 - |
Question
CGRect myImageRect = CGRectMake(3165, 1197, 332,43);
UILabel *myLabel = [[UILabel alloc] initWithFrame:myImageRect];
myLabel.text = @"WASHINGTON D. C.";
NSAutoreleaseNoPool(): Object 0x7a39750 of class UICFFont autoreleased with no pool in place - just leaking NSAutoreleaseNoPool(): Object 0x6fc3920 of class UITextRenderingAttributes autoreleased with no pool in place - just leaking
the stack trace from a breakpoint in the above code can be found here : img52.imageshack.us/img52/9616/tutc.png
I'm using iPhone WWDC 2010 - 104 PhotoScroller (it includes Tiling View.h)
How to solve this problem ?
Solution
Is this code being run on a background thread?
You need to make an autorelease pool
// At the start of your thread
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
...
CGRect myImageRect = CGRectMake(3165, 1197, 332,43);
UILabel *myLabel = [[UILabel alloc] initWithFrame:myImageRect];
myLabel.text = @"WASHINGTON D. C.";
...
// At the very end of your thread
[pool release];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow