Re: [AD] SF.net SVN: alleg:[11915] allegro/branches/4.9/src

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


On 2009-03-22, Milan Mimica <milan.mimica@xxxxxxxxxx> wrote:
> tjaden@xxxxxxxxxx wrote:
> > Revision: 11915
> >           http://alleg.svn.sourceforge.net/alleg/?rev=11915&view=rev
> > Author:   tjaden
> > Date:     2009-03-22 01:35:26 +0000 (Sun, 22 Mar 2009)
> > 
> > Log Message:
> > -----------
> > Do not rely on al_install_system() to set up display options.
> > 
> > al_create_display() can be called from a thread that did not call
> > al_install_system() nor al_reset_new_display_options().
> > This previously broke ex_threads.
> > 
> > Modified: allegro/branches/4.9/src/system_new.c
> > ===================================================================
> > --- allegro/branches/4.9/src/system_new.c	2009-03-22 01:25:15 UTC (rev 11914)
> > +++ allegro/branches/4.9/src/system_new.c	2009-03-22 01:35:26 UTC (rev 11915)
> > @@ -178,8 +178,6 @@
> >  
> >     al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb(255, 255, 255));
> >  
> > -   al_reset_new_display_options();
> > -
> >     if (atexit_ptr && atexit_virgin) {
> >        atexit_ptr(al_uninstall_system);
> >        atexit_virgin = false;
> 
> OK, but no need to remove this call from here. This was supposed to init the 
> settings struct in TLS so that you can call al_set_new_display_option() and 
> others before you create a display (which is what you will usually want to do).
> Currently all examples using using al_set_new_display_option() crash because of 
> this.

Yes, I see.  Not all of the examples crash, for some reason.

This wouldn't solve the problem for new threads though.  What do you
think about implicitly calling al_reset_new_display_options() in
al_set_new_display_option(), if it wasn't explicitly called by the user?

Another issue is that when the thread exits there will be a memory leak.
This is a more general problem, though, which we don't have to solve
right now.

BTW, the release is delayed until at least tomorrow night (here) to give
Trent a chance to debug a problem in Windows.

Peter





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