finalization
DragDropShutdown := True;
// Note: Due to unit finalization order, is is possible for the following two
// objects to be recreated after this units' finalization has executed.
// If that happens it will result in a harmless one-time memory leak.
if (FDataFormatMap <> nil) then
FDataFormatMap.Free;
if (FDataFormatClasses <> nil) then
FDataFormatClasses.Free;
with this code:
finalization
DragDropShutdown := True;
// Note: Due to unit finalization order, is is possible for the following two
// objects to be recreated after this units' finalization has executed.
// If that happens it will result in a harmless one-time memory leak.
Replace in DragDrop.pas this code:
finalization DragDropShutdown := True; // Note: Due to unit finalization order, is is possible for the following two // objects to be recreated after this units' finalization has executed. // If that happens it will result in a harmless one-time memory leak. if (FDataFormatMap <> nil) then FDataFormatMap.Free; if (FDataFormatClasses <> nil) then FDataFormatClasses.Free;
with this code:
finalization DragDropShutdown := True; // Note: Due to unit finalization order, is is possible for the following two // objects to be recreated after this units' finalization has executed. // If that happens it will result in a harmless one-time memory leak.
FreeAndNil(FDataFormatMap); FreeAndNil(FDataFormatClasses);
In theory is the same. If my code is used hoever, there will be an assertion failure when you install the package.
DragDropDR104R - Delphi 10.4 - DragDrop [Built] Assertion failure (DragDrop.pas, line 1661)
This is a clear indicate on free after use!