Delphi XE7 - When using custom styles (Project, Options, appearance) OnDestroy never gets called. Using default-native-windows skin-theme, form destroy is called as expected, is this normal? If so, what are other alternatives besides OnClose?
Blank project, OnDestroy():
procedure TForm1.FormDestroy(Sender: TObject);
begin
ShowMessage('destroy called only when not using styles');
end;
Solution and advice:
When using styles (see @andreas advice): onDestroy() is not a good place to put code, since application termination will not wait for all code to finish, some code might be executed but there is a chance not all.