I have a big issue with a Firemonkey DLL in RAD Studio 10.1 Berlin.
I followed other solutions, like this one, without success.
I tried to use WinApi.GDIPapi and WinAPI.GDIPObj without changing behavior.
The DLL file is simple:
form.free (I also tried FreeAndNil(Form)).
When I unload the DLL with FreeLibrary(), I always get this result:
:02C76A7E TPlatformServices.SupportsPlatformService + $1E
:5005f79f TObject.Free + $B
:5005f79f TObject.Free + $B (this is not an typo, it’s an repetition)
:02c0ef9c TStyleContainer.Destroy + $38
:02c505ff FinalizeForms + $F
First chance exception at $02C76A7E. Exception class $C00000005 with message ‘access violation at 0x02C76A7E: read of address 0x0000000004’.
In the debugger’s EventLog, the last unload is on Normaliz.dll.
The strange thing is, when I don’t unload the DLL, the application runs fine on some systems (on my Windows 10 dev PC, and a Windows 7 VM, it runs fine), but on other systems, it crashes on application exit.
I’ve tried also with a VCL form in a VCL DLL, a VCL form in a FMX DLL, and a bash executable with an FMX form.
I’ve tried also manually initializing GDI+ in the host application and in the DLL functions, without success.
There are two forms: a main form and a virtual keyboard form (which isn’t instantiated on my tests, so there is only one form instantiated).
Does anyone have experience on this issue, or any suggestions?