|
Probably a memory leak when forcing opengl on windows |
Aikei_c
Member #14,871
January 2013
|
I used the same tutorial I use every time to check for allegro bugs: al_set_new_display_flags(ALLEGRO_OPENGL); right before creating the display. I checked with Memory Validator (http://www.softwareverify.com/cpp-memory.php) for leaks after program termination and I get 4 leaks at the end of the program, all of which have something to do with the following calls (I'll put the * marks around the line which memory validator complains about: 1. system.c 236 : /* Check for a user-defined system driver first */ 237 : real_system = find_system(&_user_system_interfaces); 238 : 239 : /* If a user-defined driver is not found, look for a builtin one */ 240 : if (real_system == NULL) { 241 : *real_system = find_system(&_al_system_interfaces);* 242 : } 243 : 244 : if (real_system == NULL) { 245 : active_sysdrv = NULL; 246 : return false;
|
| 167 : 168 : _al_vector_init(&_al_win_system->system.displays, sizeof (ALLEGRO_SYSTEM_WIN *)); 169 : 170 : _al_win_system->system.vt = vt; 171 : 172 : *d3d_available = maybe_d3d_init_display();* 173 : 174 : return &_al_win_system->system; 175 : } 176 : 177 :
| 141 : 142 : 143 : static bool maybe_d3d_init_display(void) 144 : { 145 : #ifdef ALLEGRO_CFG_D3D 146 : *return _al_d3d_init_display();* 147 : #else 148 : return false; 149 : #endif 150 : } 151 :
| 694 : 695 : 696 : ALLEGRO_INFO("Render-to-texture: %d\n", render_to_texture_supported); 697 : 698 : present_mutex = al_create_mutex(); 699 : *_al_d3d_lost_device_mutex = al_create_mutex();* 700 : 701 : _al_d3d_bmp_init(); 702 : 703 : return true; 704 : }
| 281 : ALLEGRO_MUTEX *al_create_mutex(void) 282 : { 283 : ALLEGRO_MUTEX *mutex = al_malloc(sizeof(*mutex)); 284 : if (mutex) { 285 : _AL_MARK_MUTEX_UNINITED(mutex->mutex); 286 : *_al_mutex_init(&mutex->mutex);* 287 : } 288 : return mutex; 289 : } 290 : 291 :
|
| Then there are three more, which also have something to do with creating mutexes in _al_d3d_init_display(); |
Edgar Reynaldo
Major Reynaldo
May 2007
|
fyi, the code tag comes with a bonus - if you put 3 asterisks after a line of code it will highlight that line of code for you, usually unless it chokes, but it does fine most the time. Too bad it can't find the offending line of code that frees the mem that doesn't exist yet. Now then it would be a good memory tool. Fix the leak! Submit a patch against git! My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Aikei_c
Member #14,871
January 2013
|
Unfortunately, I'm too noob of a programmer to do that myself. |
pkrcel
Member #14,001
February 2012
|
Why forcing an OpenGL Display should let Allegro Stakc the calls into the D3D submodule? It is unlikely that Google shares your distaste for capitalism. - Derezo |
|