jayhf / OpenTkControl

A faster way to use OpenTk in WPF without Forms dependencies
MIT License
30 stars 6 forks source link

ThreadOpenTkControl System.AccessViolationException #2

Open MonoMaxMW opened 6 years ago

MonoMaxMW commented 6 years ago

I'm using your control in combination with AvalonDock to use dockable Panes like with VisualStudio. When undocking or docking the pane, sometimes a System.AccessViolationException happens.

GL.ReadPixels(0, 0, _bitmapWidth, _bitmapHeight, PixelFormat.Bgra, PixelType.UnsignedByte, _backBuffer);
_previousUpdateImageTask = RunOnUiThread(() => UpdateImage(dirtyArea));

[Exception Infos] An unhandled exception of type 'System.AccessViolationException' occurred in OpenTK.dll Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. occurred

OpenTkControl.AvalondockExample.zip