Open HopeForWholeVillage opened 2 years ago
Looks like this issue, see my comment for a workaround: https://github.com/jmeubank/tdm-gcc/issues/38#issuecomment-913016367
a little safer way to do it maybe ?
while { atexit( __SHMEM_NAME( cleanup_local_region ) ) == 0 };
must be changed in the patches from _onexit should only run atexit if it can successfully do so i hope.
been a while since i coded last xD forget the above, it also returns 0 on error in the mutex lock so not applicable. i changed the code for the mutex lock to use exit(EXIT_SUCCESS); instead of returning 0.
I have an application which compiled by TDM-GCC 10.3.0, and it use
LoadLibrary
to link a DLL. After the application run, it will crash. When debug it, cause SIGSEGV signal. In DLL, there is a function containsnew
operator, but this function never be called.My OS is windows 10 (64 bits).
The code of application in 'main.cpp' shows below:
And the code of DLL in 'dllx.cpp' :
The code of file 'dllx.hpp':
If I commented line
::FreeLibrary(hDll);
in application or use linereturn nullptr;
to replace linereturn new SayImpl();
in DLL, the problem resolved.Is it a bug of TDM-GCC? How can I use
FreeLibrary
andnew
operator?