Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DXGLContext dispose #135

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Krugpelke
Copy link

@Krugpelke Krugpelke commented Aug 9, 2024

This fixes a couple of things related to DXGLContext dispose:

  • A call to DXCloseDeviceNV with an empty GLDeviceHandle crashes with AccessViolationException. This checks if GLDeviceHandle isn't empty beforehand.
  • Removed finalizer dispose as it might run from any thread and GlwfWindow can only be disposed on main thread.
  • Added a call to dispose before throwing an exception in ctor to ensure proper clean-up.

In my case I can now properly handle when the control can't initialize on integrated gpus without crashing. Maybe fixes 113 and 132 as they're similar to what I've encountered (though these may not be related as I now see that NativeWindow also has a finalizer).

… dispose and added calls to dispose before throwing an exception in ctor
@NogginBops NogginBops added this to the 4.3.3 milestone Aug 9, 2024
@NogginBops NogginBops added bug Something isn't working 4.0 labels Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.0 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dispose error on unitialized control
2 participants