KnightWRX macrumors Pentium Original poster Dec 15, 2010 #1 Does the following code result in bad stuff happening ? Code: - (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); /* unimportant stuff happens here */ CGContextRelease(context); }
Does the following code result in bad stuff happening ? Code: - (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); /* unimportant stuff happens here */ CGContextRelease(context); }
robbieduncan Moderator emeritus Dec 15, 2010 #2 I'm not sure. It looks like it might as you don't own the context you are releasing...
PhoneyDeveloper macrumors 68040 Dec 15, 2010 #3 Yes. Read about the Get Rule http://developer.apple.com/library/...nceptual/CFMemoryMgmt/Concepts/Ownership.html
Yes. Read about the Get Rule http://developer.apple.com/library/...nceptual/CFMemoryMgmt/Concepts/Ownership.html
KnightWRX macrumors Pentium Original poster Dec 15, 2010 #4 PhoneyDeveloper said: Yes. Read about the Get Rule http://developer.apple.com/library/...nceptual/CFMemoryMgmt/Concepts/Ownership.html Click to expand... Interesting document, a good read. I figured as much as soon as all the "Invalid context" errors popped up the second time I went through drawRect but still good to get to read the actual API docs on it.
PhoneyDeveloper said: Yes. Read about the Get Rule http://developer.apple.com/library/...nceptual/CFMemoryMgmt/Concepts/Ownership.html Click to expand... Interesting document, a good read. I figured as much as soon as all the "Invalid context" errors popped up the second time I went through drawRect but still good to get to read the actual API docs on it.