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 GC issues with static events. #759

Merged
merged 2 commits into from
Mar 11, 2021
Merged

Conversation

manodasanW
Copy link
Member

  • When GC was ran, the static class instance gets cleaned up as it is a weak lazy reference But that causes issues when the static class supports static events as any added events stay added and are associated with the previous instance. Fixing this by making the static class instance not weak lazy if it it has static events which can be added to. This has the effect of not cleaning up the instance on GC when there is no events added, but guarantees we are always adding to the same event source to replicate a static class behavior.

Fixes #753

@manodasanW manodasanW requested a review from Scottj1s March 5, 2021 08:11
@manodasanW manodasanW merged commit 006ad4e into master Mar 11, 2021
@manodasanW manodasanW deleted the manodasanw/staticevent branch March 11, 2021 21:44
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

Successfully merging this pull request may close these issues.

Unsubscribing from a WinRT event sometimes does not work.
2 participants