Re: [AD] Patch for fixing missing NSAutoreleasePools

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


Does ex_mouse_cursor work alright with that change?

When I added a pool in _al_osx_create_mouse_cursor, it caused a segfault when the NSImage was returned as autorelease, as the pool was drained before returning the cursor.

26 maj 2012 kl. 08.40 skrev Trent Gamblin:

> On 2012-05-26, at 12:24 AM, Evert Glebbeek wrote:
>> I can't say either way without more context/looking into it. Agree it looks a bit odd though.
> 
> Reading up about it here: http://cocoadev.com/wiki/AutoRelease
> 
> Leads me to believe that it should be return [img autorelease];
> 
> Basically sending autorelease to an object makes it "self destruct" on the local autorelease pool ends. The image returned is used by some objc methods but those should retain it if the need to, and running ex_icon, it seems to work fine. I'll commit it that way for now, it can be changed if somebody knows better than me.
> 
> Trent
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> -- 
> https://lists.sourceforge.net/lists/listinfo/alleg-developers





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