Tech Off Post

Single Post Permalink

View Thread: is 'new object().property' or 'new object().method()' a good idea?
  • User profile image

    I ~think what your asking is if that var gets collected correctly as it is an internal assignment.  That is interesting as I recall a c# ng thread circa 2.0 that someone showed that is was never collected even after some GCs.  I personally did not test or repro the issue, but IIRC, others could repo the issue.  Me thinks it was fixed, but not sure.  Save that issue, I don't see a problem other then it would be easier to debug if ctor and assignment was on a line by itself and maybe more clear.