私は自分のアプリケーションでWindows 10 Notificationを実装しています。しかし、(正常に動作)以下のコードは明らかに1 TNotificationオブジェクトと、2列のメモリークを与える、まだ私がブロックの最後にオブジェクトを解放:Windows 10でのメモリリークDelphi SeattleでのTNotification?
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;
私は愚かな何かをやったりがありアムNotificationsの実装におけるメモリリーク?
- スティーブ
「NotificationCenter.PresentNotification(aNotification)」の後の「aNotification」の値は何ですか? –
@HughJones 'aNotification'はまだ' PresentNotification'の後に割り当てられています。 –
私は前に多くの月間にデルファイを行い、何も設定しないことを覚えています... aNotification:= nil; – KornMuffin