Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Allegro 5.0.4 crash if mixing resize/create_display

This thread is locked; no one can reply to it. rss feed Print
Allegro 5.0.4 crash if mixing resize/create_display
Max Savenkov
Member #4,613
May 2004
avatar

The following code crashes somewhere in al_create_display on a call to malloc:

ALLEGRO_DISPLAY *d = al_create_display( 800, 600 );
al_resize_display( d, 1024, 768 );
al_destroy_display( d );
al_set_new_display_flags( ALLEGRO_FULLSCREEN );
al_create_display( 1920, 1080 );

I understand that calling resize_display and then create_display is pointless, but still it shows a possible bug somewhere. At worst, this should be documented.

kenmasters1976
Member #8,794
July 2007

I can't reproduce the crash on my machine. Are you sure the crash is not caused because you are not assigning the second display to a variable?.

Max Savenkov
Member #4,613
May 2004
avatar

Yes, I'm sure. It happens before the second call to al_create_display is complete and therefore assignment/non-assignment could not have an effect in any way.

Also, this cropped up in a non-example program, where assignment was done.

I'll add some specifics about my setup then:

OS: Windows 7 64-Bit
GPU: GeForce 560 Ti
Driver: 280.26 (8.17.12.8026)

Mode: ALLEGRO_DIRECT3D

Go to: