Re: Releasing after -getBitmap -- memory not recovered?
Re: Releasing after -getBitmap -- memory not recovered?
- Subject: Re: Releasing after -getBitmap -- memory not recovered?
- From: Steve Christensen <email@hidden>
- Date: Fri, 17 Oct 2008 10:36:15 -0700
On Oct 17, 2008, at 9:33 AM, Matt Rhodes wrote:
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:...?
if (_needToCheckForImageWellImage)
{
FxBitmap* image;
_imageWellHasImage = NO;
if ([getParamAPI getBitmap:&image ...])
{
if (image != nil)
{
_imageWellHasImage = YES;
[image release];
}
}
_needToCheckForImageWellImage = NO;
}
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.
steve
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden