Since Delphi 3, NotifyModuleUnload in the System unit has been written the way it is now.
procedure NotifyModuleUnload(HInstance: THandle); var P: PModuleUnloadRec; begin P := ModuleUnloadList; while P <> nil do begin try P.Proc(HInstance); except // Make sure it doesn't stop notifications end; P := P.Next; end; {$IFDEF LINUX} InvalidateModuleCache; {$ENDIF} end;
The IDE calls NotifyModuleUnload in these conditions:
This article discusses the new Delphi 8 property access specifiers.
Continued discussion of undocumented Delphi 8 Property Access Specifiers, and other ways of adding and removing delegates / events handlers, including clearing the list of all the delegates / event handlers.