コード例 #1
0
 private void OnDestroy()
 {
     if (_videoCapture != null)
     {
         _videoCapture.FrameSampleAcquired -= OnFrameSampleAcquired;
         _videoCapture.Dispose();
     }
 }
コード例 #2
0
    private void OnDestroy()
    {
        if (_videoCapture == null)
        {
            return;
        }

        _videoCapture.FrameSampleAcquired += null;
        _videoCapture.Dispose();
    }
コード例 #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;
                }
            }
        }