/// <summary>
        /// Removes the video (must be called from the Dispatcher thread)
        /// </summary>
        private void RemoveVideo()
        {
            this.VideoSource = null;

#if NET45
            this.memoryMappedView?.Dispose();
            this.memoryMappedView = null;
            this.memoryMappedFile?.Dispose();
            this.memoryMappedFile = null;
#else
            if (this.memoryMappedFile != IntPtr.Zero)
            {
                Win32Interop.UnmapViewOfFile(this.memoryMappedView);
                this.memoryMappedView = IntPtr.Zero;
                Win32Interop.CloseHandle(this.memoryMappedFile);
                this.memoryMappedFile = IntPtr.Zero;
            }
#endif
        }
예제 #2
0
 private void VideoCleanup(IntPtr opaque)
 {
     myBitmap = null;
     Win32Interop.UnmapViewOfFile(opaque);
     Win32Interop.CloseHandle(myBitmapSectionPointer);
 }