Memory leak in Windows 10 TNotification in Delphi Seattle?

I am using Windows 10 notification in my application. However, the code below (which works fine) seems to give a memo leak of 1 TNotification object and 2 lines, but I release the object at the end of the block:

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; 

Am I doing something stupid or is there a memory leak when implementing notifications?

  • Steve
+7
windows-10 delphi notifications delphi-10-seattle
source share
1 answer

This is truly a leak caused by TNotificationCenterDelegateActivated . A copy of the TNotification parameter is created in its Create , but never freed.

It seems that some of the developers responsible for this code do not have skills in an environment other than ARC.

+8
source share

All Articles