Aurelias ManyValuedAssociation objects not being freed

I am getting memory leak notifications on objects that are loaded as part of a manyassociation. For example, I have this:
TContact = class
[Column('PodContactID', [TColumnProp.NoInsert, TColumnProp.NoUpdate])]
FPodcontactid: Int64;
[ManyValuedAssociation([], CascadeTypeAll)]
[ForeignJoinColumn('EntityID', [])]
FContactImage: TList /;
property ContactImage: TList TContactImage read FContactImage write FContactImage;

If I make a call to the Contact endpoint URL to get a list of contacts and their associated images (TList<TContactImage), the ContactImage TList never gets freed. I am calling the Aurelius generated crud endpoint for the Contact object.

How can I free the ContactImage object? If I do a service call (as opposed to using a CRUD endpoint), I can put the TContactImage object in the object manager and it frees properly (e.g., TXDataOperationContext.Current.Handler.ManagedObjects.Add(TContactImage), but I want to use the auto generated crud endpoints and those are sort of a black box.

Help is appreciated!

Figured it out. I added a destuctor to the contact entity that checks ContactImage exists and frees it. This got rid of the memory leak.

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.