예제 #1
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         try
         {
             dir.MaybeThrowDeterministicException();
         }
         finally
         {
             @delegate.Dispose();
             if (dir.trackDiskUsage)
             {
                 // Now compute actual disk usage & track the maxUsedSize
                 // in the MockDirectoryWrapper:
                 long size = dir.GetRecomputedActualSizeInBytes();
                 if (size > dir.maxUsedSize)
                 {
                     dir.maxUsedSize = size;
                 }
             }
             dir.RemoveIndexOutput(this, name);
         }
     }
 }
예제 #2
0
 public override void Dispose()
 {
     try
     {
         // turn on the following to look for leaks closing inputs,
         // after fixing TestTransactions
         Dir.MaybeThrowDeterministicException();
     }
     finally
     {
         Closed = true;
         @delegate.Dispose();
         // Pending resolution on LUCENE-686 we may want to
         // remove the conditional check so we also track that
         // all clones get closed:
         if (!IsClone)
         {
             Dir.RemoveIndexInput(this, Name);
         }
         else
         {
             //Could this be where things aren't being deleted?
         }
     }
 }
예제 #3
0
 public override void Dispose()
 {
     try
     {
         Dir.MaybeThrowDeterministicException();
     }
     finally
     {
         @delegate.Dispose();
         if (Dir.TrackDiskUsage_Renamed)
         {
             // Now compute actual disk usage & track the maxUsedSize
             // in the MockDirectoryWrapper:
             long size = Dir.RecomputedActualSizeInBytes;
             if (size > Dir.MaxUsedSize)
             {
                 Dir.MaxUsedSize = size;
             }
         }
         Dir.RemoveIndexOutput(this, Name);
     }
 }