Beware of local scoping in .NET

Last week Jordan Parker and I were looking at a chunk of code that was evidently leaking memory.  What we discovered wasn’t obvious at first so I thought I’d share it with the world.  The code looked something like this: void BackgroundThreadProc() { while (true) { _waitEvent.WaitOne(); while (!WorkQueueEmpty()) { WorkItem item = DequeueWorkItem(); ProcessWorkItem(item);…

3

Fun With Animation Part 1 – CompositionTarget.Rendering

Rich runtime support for animation is a key component of WPF and a lot can be said about it.  That is why I’ve started this multi part series of posts on the topic of having fun with WPF animations.  Typically application animations are used as subtle visual cues (think blinking caret) or not-so-subtle transitions (think…

3

The birth of a new blog.

Hello world. Yes, another blog has just been born.  I feel obligated to say a bit about what this blog is going to be about, so here it goes.I’m a developer at Microsoft on the WPF team, so much of the content here will relate to WPF.  On the other hand, I have broad interests so I…

1