Friday, August 27, 2004 6:30 PM
scottdensmore
Back in my day... we called that a memory leak
.NET is cool, but it still gives me fits sometimes. I was writing a test and in my fixture I was checking that the events I set up on my class where getting fired correctly. All things are going well on each individual test, but when I ran them all together, bang, red light, wooop wooop, Scotty… what is going on down there? “Don’t know cap’n”. Now wait a minute, I hooked all the events right and in each test I created a new object in isolation (good thing). Things seem alright, until my old school ways bit me in the a33. I keep forgetting the “garbage” lets my objects hang around till it feels ok about collecting it. The solution was to remove the delegate for the event before I left the scope of the method. So potentially back in my day I would call that a memory leak, but in reality, I am just plain ignorant.