C1 Field2; // BAD

    public override void Dispose(bool disposing)
    {
        base.Dispose(disposing);
        if (disposing)
        {
            Field1.Dispose();
        }
    }
    C1 Field2; // BAD

    protected override void Dispose(bool disposing)
    {
        base.Dispose(disposing);
        if (disposing)
        {
            Field1.Dispose();
        }
    }
Пример #3
0
 public void Dispose()
 {
     if (c1 != null)
     {
         c1.Dispose();
     }
     if (c2 != null)
     {
         c2.Dispose();
     }
 }
Пример #4
0
    C1 Field; // GOOD

    public virtual void Dispose()
    {
        Field.Dispose();
    }
    C1 Field2; // BAD

    public override void Dispose()
    {
        base.Dispose();
        Field1.Dispose();
    }