New Posts New Posts RSS Feed: Async Navigation and PendingEntityListResolved
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Async Navigation and PendingEntityListResolved

 Post Reply Post Reply
Author
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Topic: Async Navigation and PendingEntityListResolved
    Posted: 03-May-2013 at 11:25am
Hi LowOrbit,

After using .NET Memory Profiler, we were not able to see any memory leak due to creating event handlers as you described.
Based on that, I'd say it's safe to have anonymous event handlers on PendingEntityListResolved.
Back to Top
LowOrbit View Drop Down
Newbie
Newbie


Joined: 17-Aug-2007
Location: United States
Posts: 20
Post Options Post Options   Quote LowOrbit Quote  Post ReplyReply Direct Link To This Post Posted: 02-May-2013 at 12:43pm
Hello
 
I was looking at the documentation about fetching a Navigation Property asyncronyously. Below is an example of a code snippet to fetch a nav property:
 
                RelatedEntityList<AnalysisDefinitionMethod> availableMethods = aResult.AnalysisDefinitionMethods;
                availableMethods.PendingEntityListResolved += (sender, args) => args.ResolvedEntities.ForEach(e => code to load the results);
My concern here is that creating an anonymous event handler of PendingEntityListResolved will cause a memory leak because the variable availableMethods will never get garbage collected. Is this true or will the event handler be released properly when availableMethods goes out of scope?
 
Thanks!
 
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down