When I create display a for the second time i keep getting a seg fault(note: this is a secondary window created on a mouse click). when the user exits the window i call al_destroy_display() then recreate it when they want to open it. what causes a a program to crash on al_create_display other than not calling al_init()? heres the call stack:
#0 77450475 ntdll!TpWaitForAlpcCompletion() (C:\Windows\system32\ntdll.dll:??)
#1 00000000 0x0028e8f8 in ??() (??:??)
#2 7740A5FD ntdll!AlpcMaxAllowedMessageLength() (C:\Windows\system32\ntdll.dll:??)
#3 00000000 0x02b349c0 in ??() (??:??)
#4 773B3587 ntdll!RtlFindClearRuns() (C:\Windows\system32\ntdll.dll:??)
#5 0000007F ??() (z:/programs/codeblocks/mingw/bin/../lib/gcc/mingw32/4.5.2/include/c++/bits/stl_vector.h:247)
#6 00000000 0x00000938 in ??() (??:??)
#7 00000000 0x0028e9c0 in ??() (??:??)
#8 773B3472 ntdll!RtlLargeIntegerShiftRight() (C:\Windows\system32\ntdll.dll:??)
#9 00000000 0x02b34918 in ??() (??:??)
#10 7745162E ntdll!RtlValidateHeap() (C:\Windows\system32\ntdll.dll:??)
#11 00000000 0x00b10000 in ??() (??:??)
#12 7740AB3A ntdll!AlpcMaxAllowedMessageLength() (C:\Windows\system32\ntdll.dll:??)
#13 00000000 0x00b10000 in ??() (??:??)
#14 773B3472 ntdll!RtlLargeIntegerShiftRight() (C:\Windows\system32\ntdll.dll:??)
#15 00000000 0x02b34918 in ??() (??:??)
#16 764598CD msvcrt!free() (C:\Windows\syswow64\msvcrt.dll:??)
#17 00000000 0x00b10000 in ??() (??:??)
#18 004824E4 d3d_create_display_internals(ALLEGRO_DISPLAY_D3D*) () (??:??)
#19 00482DB7 d3d_create_display_locked(int, int) () (??:??)
#20 00484D5F d3d_create_display(int, int) () (??:??)
#21 00000000 0x00430f9e in al_create_display() (??:??)
#22 0041A744 _StatisticsModule::Initialize(this=0x28f948)
#23 004059F0 Core::HandleMouseClicks(this=0x28f748)
#24 0041DD68 Core::Run(this=0x28f748)
#25 00412855 main()
heres the function: