-
Notifications
You must be signed in to change notification settings - Fork 118
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
Add more WASAPI functions, interfaces and constants #800
Conversation
A bit side-tracked but after testing these API in some of my small projects, I ran into an issue when using
I couldn't find a way to do this in Flutter. Every time the code executes from a button click, the 2 different methods of the same object seem to run under a different native thread leading to segfault / silent crash. My temporary solution is to let this capture client pointer leaking to avoid the crash.. Which is far more than ideal. Any ideas on how to do this? I reckon I could use a native thread via |
Finalizers are attached to the COM objects in this package, which decrement the reference count of the object and then free its pointer (see here) when the objects go out of scope (as mentioned in the docs). Therefore, you should not free the pointers of these objects unless you're opting out of this behavior by calling the .detach() method of the object. Edit: I'll review this PR in a few days, I'm a little busy at the moment. |
Yes, I'm completely aware of what you wrote here. However, it doesn't matter if I let the finalizer run (e.g class that contains the The problem isn't likely to be reproducible by example code where everything happens in a single method (eg. init -> render/capture -> object being freed due to out-of-scope at the same method), but it happens to me in a flutter project where init, capture and free/dispose happen within different methods (e.g
Please take your time, I'm using my local build for my project for now :) |
If you can share an example of this, I'd be happy to look into it. |
Noted! I'll post a small reproducible flutter code/project later. |
Hi, I'm so sorry that I haven't updated much yet. I've been busy lately. P.S I liked your commit Add static methods to PROPERTYKEY struct, not sure why you revert it. |
The commit caused some failures that I haven't been able to diagnose. I'll make another attempt tomorrow to identify and address the issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for your contribution!
I removed the ActivateAudioInterfaceAsync
function and related COM interfaces as supporting asynchronous Win32 APIs requires some extra work and I don't have any plans to tackle this at the moment.
Sorry to bring this up again. There's no problem with releasing the COM object. It appears I'm using |
Add more WASAPI functions, interfaces, and constants.
Fix: #513