This forum is temporaily read-only. All existing discussions remain available for reference. For new questions, bug reports or support requests, please contact us at mail@lmdsupport.com.
Wrong freeing of LMDThemeServices
Hi,
LMDThemeServices will be freed in the finalization of LMDThemes. It is restricted to the main application (not IsLibrary) what is correct when a runtime package was loaded (.bpl).
We are using dll's, they are nearly "standalone". If I unload the dll, the LMDThemeServices will not be freed, the "DeallocateHWnd(FHwnd);" will not be called, bad access violations are the results.
I changed the finalization to:
finalization
if ((not IsLibrary) or (not ModuleIsPackage)) and Assigned(ThemeService) then
LMDThemeServices.Free;
This is working for me and should be correct, perhaps you can take it into the repository?
Bye
Andre Engelshove
LMDThemeServices will be freed in the finalization of LMDThemes. It is restricted to the main application (not IsLibrary) what is correct when a runtime package was loaded (.bpl).
We are using dll's, they are nearly "standalone". If I unload the dll, the LMDThemeServices will not be freed, the "DeallocateHWnd(FHwnd);" will not be called, bad access violations are the results.
I changed the finalization to:
finalization
if ((not IsLibrary) or (not ModuleIsPackage)) and Assigned(ThemeService) then
LMDThemeServices.Free;
This is working for me and should be correct, perhaps you can take it into the repository?
Bye
Andre Engelshove

Comments
after further thinking, I think that LMDThemeServices has to be always freed in finalization.
finalization
if Assigned(ThemeService) then
LMDThemeServices.Free;
Bye
Andre Engelshove
Have you confirmed the need for the changes that AEngel suggested?
I just want to know if he's right, in which case I'll add it to my own local code, before any official update in the LMD components.