Re: [AD] Issues with iPhone native image loader

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Tue, 2010-04-13 at 13:59 -0400, Evert Glebbeek wrote:
> On 13 Apr 2010, at 13:50 , Trent Gamblin wrote:
> > First, it seems that the loader cannot load paletted 8 bit png files. I have
> > an example that does not load if anyone wants to try it. This I did not
> > investigate, but it might be nice to support indexed images.
> 
> Yes, it will be. I'll see what I can find (no promises though).
> 
> > Second, I get a lot of error messages saying that UIImage and NSConcreteData
> > objects are leaking when loading images, because an autorelease pool isn't
> > set up. I'm not too familiar with programming on these systems, so as a fix
> > I simply wrapped the loading function with an autorelease pool, which quieted
> > the warnings/errors. That patch is attached.
> 
> That should be fine (although I didn't actually check your patch). A
> more proper thing to do might be to release the allocated objects
> instead, but this should work too.
> 

I don't think this is the right thing to do - we should first figure out
how a thread without an auto-release pool could call A5 functions?
Basically that must never happen as A5 functions will allocate objective
C strings at will. What we should do is make sure all threads created by
A5 (including al_create_thread_*) do have an auto-release pool and
mention in the documentation that threads created in any other way must
have an active auto-release pool on IPhone while calling A5 functions.

-- 
Elias Pschernig <elias.pschernig@xxxxxxxxxx>





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/