Re: Releasing after -getBitmap -- memory not recovered?
site_archiver@lists.apple.com Delivered-To: pro-apps-dev@lists.apple.com On Oct 17, 2008, at 9:33 AM, Matt Rhodes wrote: if (_needToCheckForImageWellImage) { FxBitmap* image; _imageWellHasImage = NO; if ([getParamAPI getBitmap:&image ...]) { if (image != nil) { _imageWellHasImage = YES; [image release]; } } _needToCheckForImageWellImage = NO; } steve _______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/site_archiver%40lists.ap... Two questions: 1. Is there a way to check that an Image Well has a bitmap/ texture without calling -getBitmap or -getTexture? I only need to check if it's empty. I don't know of any way to do that. If it is empty, -getBitmap and -getTexture return nil, as I'm sure you know. If it's not empty, you're eventually going to want to use the image, right? You could just keep it around until you need it. I guess I don't understand why you'd want to check if it's empty then not use the image it returns if it's not empty. It's a speed issue. There happens to be a situation where we only need to see what's populated (and we don't care what's in there). Not a big deal - just noticed it during my "where am I allocating memory and why" search. I guess it depends on where you're testing the state of the image well. If you're calling -getBitmap on every call to your plugin's rendering method(s) then, yeah, you're going to take a speed hit. How about doing something like this in -renderOutput:...? Obviously you'd need to set _needToCheckForImageWellImage=YES in your class' -initWithAPIManager: and -parameterChanged: methods. Even if you follow Paul's suggestion of calling - durationOfImageParm:forEffect:, you're still asking for information about the image only when there is a change. This email sent to site_archiver@lists.apple.com
participants (1)
-
Steve Christensen