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

Leaking DLL handles #58

Open
Y-Less opened this issue Jan 3, 2020 · 1 comment
Open

Leaking DLL handles #58

Y-Less opened this issue Jan 3, 2020 · 1 comment

Comments

@Y-Less
Copy link
Contributor

Y-Less commented Jan 3, 2020

There's no cleanup in SharpVk.Interop.NativeLibrary. A standard setup will call SharpVk.Instance.EnumerateExtensionProperties, SharpVk.Instance.EnumerateVersion, SharpVk.Instance.Create and probably more. All of these create new instances of NativeLibrary, all getting a handle to vulkan-1.dll, but none of them cleaning it up again.

@FacticiusVir
Copy link
Owner

NativeLibrary was always a bit of a hack to handle the different DLL names on different OSes; the helper methods on Instance that create it were written on the assumption you'd only call them a small number of times when the app starts.
There are overloads that accept a CommandCache instance (which wraps NativeLibrary), so you can create it once and re-use it; but now that .NET Core 3 has improved DLL mapping I need to revisit how that whole section works.

@FacticiusVir FacticiusVir transferred this issue from FacticiusVir/SharpVk-Samples Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants