Windows 10中的内存泄漏在Delphi西雅图进行通知?

Windows 10中的内存泄漏在Delphi西雅图进行通知?,delphi,notifications,windows-10,delphi-10-seattle,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 aN

我正在应用程序中实现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;
我是在做傻事还是在通知的实现中存在内存泄漏

  • 史蒂夫

这确实是由
t通知中心代理激活引起的泄漏。在其
Create
中,创建了
t通知
参数的副本,但从未释放


似乎一些负责此代码的开发人员对非ARC环境不太精通。

通知中心之后
aNotification
的价值是什么。PresentNotification(aNotification)
?@HughJones
呈现通知后仍然分配了一个加密
-太奇怪了。我在很多月前做过Delphi,还记得把事情设置为零。。。说明:=无;RAD Studio的问题跟踪程序中出现了一个关于mem泄漏的问题:感谢您的确认。在Emba进行质量控制将是一件好事。天真的人可能会认为Emba会对他们的库进行测试,以清除泄漏。这有多难?@DavidHeffernan天真地认为他们有一个简单的应用程序要测试,而编写的第一行代码是
ReportMemoryLeaksOnShutdown:=true@Hugh No它与垃圾收集不同