UICFFont autoreleased sans piscine en 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 de classe UICFFont autoreleased sans piscine en place - juste une fuite NSAutoreleaseNoPool (): Objet 0x6fc3920 de classe UITextRenderingAttributes autoreleased sans piscine en place - juste fuite
la trace de la pile d'un point d'arrêt dans le code ci-dessus se trouve ici: img52.imageshack .us / img52 / 9616 / tutc.png
J'utilise iPhone WWDC 2010-104 PhotoScroller (il comprend Carreleurs View.h)
Comment résoudre ce problème?
La solution
Est ce code en cours d'exécution sur un thread d'arrière-plan?
Vous devez faire une piscine autorelease
// 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];
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow