GPUImage icon indicating copy to clipboard operation
GPUImage copied to clipboard

GPUImageToneCurveFilter crashes

Open gessl opened this issue 14 years ago • 5 comments

GPUImageToneCurveFilter crashes. The following fix solved the problem:

    NSMutableArray *preparedSplinePoints = [[NSMutableArray arrayWithCapacity:[splinePoints count]] retain];

gessl avatar Oct 23 '12 04:10 gessl

That won't even compile, because this is an ARC-enabled project. You can't call -retain.

BradLarson avatar Oct 23 '12 14:10 BradLarson

I see. I am using GPUImage in a non-ARC project and I'm including the GPUImage project inside mine, per instructions. Yet without the change the array is prematurely released in my setting. And oddly the fix does compile for me and solve the problem. I'll explore further.

gessl avatar Oct 23 '12 14:10 gessl

The whole framework is dependent on being built using ARC, so there's no way the compiler should allow -retain there. If it is, then that file (among others) is not being built correctly, and a crash here will be the least of your worries because the whole framework will leak memory like a sieve. If included as a sub-project, this should always build using the project defaults, which has ARC enabled, unless you're using a version of Xcode that lacks support for ARC.

BradLarson avatar Oct 23 '12 14:10 BradLarson

Thanks. I managed to fixed it now. I had the project and the source both inside my project. Apologies for the false bug report. The mistake was completely on my end.

gessl avatar Oct 23 '12 14:10 gessl

Better to find that out now than have your application start failing in very weird ways. I've done this in the past, and things went south in a hurry.

BradLarson avatar Oct 23 '12 15:10 BradLarson