Ich implementiere Windows 10 Benachrichtigung in meiner Anwendung. Jedoch unterhalb der Code (was in Ordnung läuft) offenbar ein Memo Leck von 1 TNotification Objekt und 2 Strings geben, aber ich frei, das Objekt am Ende des Blocks:Speicherverlust in Windows 10 TNotification in Delphi Seattle?
aNotification := NotificationCenter.CreateNotification;
//-- If not assigned then must be Win 8.1 or below
if not assigned(aNotification) then
exit;
try
aNotification.Title := AlignMixVersionName + ' License';
aNotification.AlertBody := aText;
NotificationCenter.PresentNotification(aNotification);
finally
aNotification.Free;
end;
Bin ich etwas Dummes zu tun oder gibt es ein Speicherleck in der Implementierung von Benachrichtigungen?
- Steve
Welchen Wert hat 'aNotification' nach' NotificationCenter.PresentNotification (aNotification) '? –
@HughJones 'aNotification' wird immer noch nach' PresentNotification' zugewiesen - so seltsam. –
Ich habe Delphi vor vielen Monden gemacht und erinnere mich, Dinge auf Null gesetzt zu haben ... aNotification: = nil; – KornMuffin