Exemple #1
0
 public override void Close()
 {
     if (comStream != null)
     {
         try {
             comStream.Commit(NativeMethods.STGC_DEFAULT);
         }
         catch (Exception) {
         }
         comStream = null;
     }
 }
 protected override void Dispose(bool disposing)
 {
     try {
         if (disposing && comStream != null)
         {
             try {
                 comStream.Commit(NativeMethods.STGC_DEFAULT);
             }
             catch (Exception) {
             }
         }
         // Can't release a COM stream from the finalizer thread.
         comStream = null;
     }
     finally {
         base.Dispose(disposing);
     }
 }