With MDA enabled in Visual Studio 2010, assistant constintenlty activates ReleaseHandleFailed on every CustomLineCap dispose, e.g.:
GraphicsPath gp = new GraphicsPath();
CustomLineCap clp = new CustomLineCap(gp, null);
clp.Dispose();
Of course it is only simple example but even here I get the assistant's call, which is:
A SafeHandle or CriticalHandle of type
'System.Drawing.Drawing2D.SafeCustomLineCapHandle' failed to properly release the
handle with value 0x00000000. This usually indicates that the handle was released
incorrectly via another means (such as extracting the handle using DangerousGetHandle
and closing it directly or building another SafeHandle around it.)
Is it something wrong with the class? All available constructors of this class lead to this assistant behavior, no matter what shape residues in gp. Finally the question is: How properly should I dispose the CustomLineCap instances?
Dawid.