Esempio n. 1
0
 private void OnDestroy()
 {
     if (_videoCapture != null)
     {
         _videoCapture.FrameSampleAcquired -= OnFrameSampleAcquired;
         _videoCapture.Dispose();
     }
 }
Esempio n. 2
0
    private void OnDestroy()
    {
        if (_videoCapture == null)
        {
            return;
        }

        _videoCapture.FrameSampleAcquired += null;
        _videoCapture.Dispose();
    }
Esempio n. 3
0
        /// <summary>
        /// Raises the destroy event.
        /// </summary>
        protected override void OnDestroy()
        {
            Dispose();

            if (videoCapture != null)
            {
                if (videoCapture.IsStreaming)
                {
                    videoCapture.StopVideoModeAsync(result => {
                        videoCapture.Dispose();
                        videoCapture = null;
                    });
                }
                else
                {
                    videoCapture.Dispose();
                    videoCapture = null;
                }
            }
        }