Re: [AD] Two custom mouse cursor patches |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
There are two options 1. Don't do any retains. System cursors are fine because they're built in. Custom cursors are managed 'externally' by the lifetime of the ALLEGRO_CURSOR. We will need to get rid of the release on line 674 (destroy_display) At the moment I think there might be a problem if the same custom cursor is active in two windows when it is destroyed.
Testing with ex_mouse_cursor, I don't see any problems in practice. Doesn't mean there aren't any of course. :) I thought I might actually have too many retains in there, which would leak memory if a cursor was actually discarded.
2. Do a 'proper' retain/release whenever display->cursor is changed. This is a bit more work but would solve the problem above. I've got a patch for this and I'll post it later (I can't get to it at the moment)
That does sound like the correct approach, yes. Since you already have a patch for this I'll leave this to you (I can test it of course).
Evert
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |