Skip to content
Discussion options

You must be logged in to vote

Hi! Thanks for using SharpHook!

As far as I can see the problem is in this code:

await hook.RunAsync();
hook.Dispose();

The Dispose method is never actually going to be called. In the code above you need to stop awaiting RunAsync to dispose, but RunAsync will finish only after disposing. You need to call Dispose in another place - some code that gets called when the application is about to stop, like a window closed event handler. I don't have any experience with MAUI, so I can't help with the specifics.

Actually, there's an issue in SharpHook itself. The hook runs in a separate thread - that thread should be a background thread, and it isn't. Thanks for the catch, I'll fix that in the ne…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by TolikPylypchuk
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants