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

Dangerous use of statics #46

Open
petiaccja opened this issue Aug 9, 2018 · 0 comments
Open

Dangerous use of statics #46

petiaccja opened this issue Aug 9, 2018 · 0 comments
Assignees
Labels

Comments

@petiaccja
Copy link
Owner

ScreenSpaceAmbientOcclusion:28
static int temporalIndex = 0;

You do NOT ever ever ever ever ever ever ever ever ever use statics to store persistent class-scope read-write data, because it is ugly. Furthermore, it will crash as soon as two instances of the class exist, especially in a multithreaded environment. And no, thread_local is just as bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants