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

Remove use of NotificationCenter #15

Merged
merged 3 commits into from
Jan 31, 2022
Merged

Conversation

amiantos
Copy link
Owner

I had a theory that the freezing part of this issue #6 was because of my use of NotificationCenter.default, namely that when firing the 'animationComplete' messages, they were being received by both instances of the screensaver, which made things get wonky. I didn't do anything to prove this theory, beyond the work of this PR.

I removed any usage of NotificationCenter and replaced it instead with completion handlers. It seems like this fixed the issue with multiple instances of the screensaver as well as fixed a millisecond or two delay when progressing through the animation queue, which is a nice benefit. Overall much better to do it this way, though it did mean I had to add a bunch of completionHandler arguments to stuff in the Animation file...

@amiantos amiantos self-assigned this Jan 31, 2022
@amiantos
Copy link
Owner Author

Memory usage seems to have gone up from ~60mb to ~100mb which is interesting. I don't see anything looking like a memory leak... letting the macOS target run for a while to see what happens.

@amiantos
Copy link
Owner Author

amiantos commented Jan 31, 2022

Well something leaks, SpriteKit related, but it doesn't look like memory usage goes much above 108mb anyway. So I don't think it's anything to worry about or anything I did specifically...

Screen Shot 2022-01-30 at 8 00 49 PM

Screen Shot 2022-01-30 at 8 01 13 PM

@amiantos amiantos merged commit 28f203e into main Jan 31, 2022
@amiantos amiantos deleted the remove-notification-center branch January 31, 2022 04:03
@amiantos amiantos mentioned this pull request Jan 25, 2023
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.

1 participant