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: assert for GUI thread in getters instead of get(I)App #5102

Merged
merged 6 commits into from
Jan 18, 2024

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Jan 18, 2024

getIApp and getApp can only be called from the GUI thread, as they contain singletons that expose functionality only available in the GUI thread. I'm adding a getCApp that returns a subset of IApplication which is safe to use outside the GUI thread. It should be obvious, that const &Paths and const &Args are safe to use outside the GUI thread [as long as no one keeps a &Path/&Args and they have been initialized].

Not sure how to call the new supertype. I was thinking of "C" for "concurrent".

@Nerixyz Nerixyz changed the title refactor: put Paths and Args into special supertype fix: assert for GUI thread in getters instead of get(I)App Jan 18, 2024
@pajlada pajlada enabled auto-merge (squash) January 18, 2024 19:34
@pajlada pajlada merged commit 4f2ca3b into Chatterino:master Jan 18, 2024
20 checks passed
@Nerixyz Nerixyz deleted the refactor/paths-and-args-to-capp branch January 18, 2024 19:51
devJimmyboy pushed a commit to devJimmyboy/chatterino7 that referenced this pull request Feb 11, 2024
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.

2 participants