Hello guys.
I'm getting a crash in my ManyMouse program. This time I've built it with MSVS 2015 and the Allegro 5 Nuget package. It crashes on startup when I try to create a timer in al_create_timer.
Here's the backtrace :
# allegro-debug-5.2.dll!_al_mutex_lock(_AL_MUTEX * m) Line 59 # allegro-debug-5.2.dll!_al_register_destructor(_AL_DTOR_LIST * dtors, const char* # name , void * object, void (void *) * func) Line 166 # allegro-debug-5.2.dll!al_create_timer(double speed_secs) Line 235 # ManyMouseRawInputTest.exe!RawInputHandler::SetupWindows() Line 435 # ManyMouseRawInputTest.exe!main(int argc, char * * argv) Line 59
And here's the value of the local variables in frame 2 (al_create_timer line 235). Notice that al_dtor_list is NULL.
+ _al_dtor_list 0x00000000 <NULL> _AL_DTOR_LIST * speed_secs 0.016666666666666666 double + timer 0x0074a230 {es={__pad=0x0074a230 {7757888, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...} } ...} ALLEGRO_TIMER * timer->counter 0.00000000000000000 double timer->speed_secs 0.016666666666666666 double
Here's line 235 of al_create_timer :
The exact same program compiled with MinGW 4.8.1 does not crash there. So it may be something to do with dlls? But I don't know what, because al_install_system is succeeding, otherwise the program would quit before it got there.
I can't get a simple test program to fail in the same way. This code works and exits with return code 0.
EDIT
Any idea why the same program compiled with MSVS 2015 would crash while one compiled with MinGW would work?
It shouldn't have anything to do with resources, and the fact that it is crashing inside an innocuous function like al_create_timer is a bit odd, as Allegro has been successfully initialized.