3

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.

Cyril Gandon
  • 16,830
  • 14
  • 78
  • 122
dawid
  • 190
  • 1
  • 12
  • At my office one person gets this error every time on his computer whereas the other four of us never see it. It seems to be machine/configuration-specific. – Brannon Aug 08 '12 at 15:30
  • Same here, with the derive class AdjustableArrowCap. You could prevent the debugger from yelling (http://stackoverflow.com/questions/5927654/getting-releasehandlefailed-mda-in-the-finalizer-thread-after-using-cryptograp), but it doesn't solve the problem. – Cyril Gandon Oct 10 '12 at 13:55

0 Answers0