//
 // Not strictly necessary, but the movie might be very large, so we might
 // as well help the system by disposing before the GC kicks-in
 //
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         movie.Dispose();
         captureSession.Dispose();
         captureInput.Dispose();
         decompressedVideo.Dispose();
     }
     base.Dispose(disposing);
 }
Ejemplo n.º 2
0
        //
        // Not strictly necessary, but the movie might be very large, so we might
        // as well help the system by disposing before the GC kicks-in
        //
        protected override void Dispose(bool disposing)
        {
            if (captureSession != null)
            {
                captureSession.StopRunning();
            }

            if (captureInput != null && captureInput.Device != null && captureInput.Device.IsOpen)
            {
                captureInput.Device.Close();
            }

            if (disposing)
            {
                movie.Dispose();
                captureSession.Dispose();
                captureInput.Dispose();
                decompressedVideo.Dispose();
            }

            base.Dispose(disposing);
        }