Consider the following code throws an exception 'MILERR_WIN32ERROR':
while(true)
{
System.Windows.Media.Imaging.WriteableBitmap writableBitMap =
new System.Windows.Media.Imaging.WriteableBitmap(100, 200, 96, 96, System.Windows.Media.PixelFormats.Bgra32, null);
}
WriteableBitmap does not implement IDisposable, I'm not sure why the memory leak is happening at all (the original code I had was much more complicated and I tracked it down to this).