SDL2 has a serious issue with closing the load-time dynamic loaded SDL2.DLL on win32.
So, I have a DLL called ground.dll which uses SDL2 by using load-time DLL loading. This load-time linking is not fully dynamic, but still dynamic. This ground.dll is created with Visual Studio C++. In my main FASM generated assembly program, I load-time load this ground.dll. The is no problem loading the DLL, but ProcessExit gets an crash error. It causes an werfault.exe (Windows Error Reporting).
All this happens without calling a single SDL2 function yet.
So, I tested if fully dynamic loading of the ground.dll fixes the issue, using LoadLibrary and FreeLibrary. This did not solve the issue.
I was very suprised to find this bug, because SDL2 is a much used library.
What might be the problem? Is the FASM assembled main program not correctly closing the SDL2? Perhaps... I created a C program which load-time loads the ground.dll and that program does not crash. However, the fact that even fully dynamic loading and freeing the library also causes the exit-crash, without calling a SDL2 function whatsoever, makes me think I cannot put the blame on FASM.
At this moment, I worked around the problem. I created a Visual Studio C++ program which loads the SDL2.dll. That program does not crash.
Geen opmerkingen:
Een reactie posten