Ste*_*han 8 delphi notifications windows-10 delphi-10-seattle
我正在我的应用程序中实现Windows 10通知.但是,下面的代码(运行正常)显然会给出1个TNotification对象和2个字符串的备忘录泄漏,但我在块的末尾释放了对象:
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;
Run Code Online (Sandbox Code Playgroud)
我做了一些愚蠢的事情,或者在通知的实施中是否存在内存泄漏?
这确实是一个泄漏造成的TNotificationCenterDelegateActivated.在其创建Create的TNotification参数副本中,但从未释放过.
似乎一些负责此代码的开发人员并不熟悉非ARC环境.
| 归档时间: |
|
| 查看次数: |
662 次 |
| 最近记录: |