-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Improve init and termination with counting #2070
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
base: master
Are you sure you want to change the base?
Conversation
Had a small discussion on IRC, logging here for the record. Essentially, the backwards compatibility of GLFW is quite important and the current state of the PR would affect the behavior for developers that are relying on the multiple init (with the superfluous ones ignored) + single termination. I proposed a new It seems reasonable and I can spend a bit of time on that approach depending on @wintertime's reponsiveness. CC @elmindreda to confirm the viability of the idea. |
Hi, I saw the first, happy reply in email, but did not get a notification for the completely different edit. It was pure luck I did not find it a month later. I disagree, adding a hint to conditionally keep the bug (or strange behaviour oversight) would not be a feasible approach:
|
Counts additional calls to glfwInit and waits with termination until the same amount of calls to glfwTerminate is done. For normal users nothing should change. For libraries/plug-ins they can now call glfwInit and glfwTerminate additional times as long as the calls are balanced. This avoids the problem that they would terminate GLFW completely when the main application is still using it.
0649202
to
6ea6273
Compare
I prefer the PR as-is, but that'll be a tough sell to @elmindreda. |
Counts additional calls to glfwInit and waits with termination until the same
amount of calls to glfwTerminate is done.
For normal users nothing should change.
For libraries/plug-ins they can now call glfwInit and glfwTerminate additional
times as long as the calls are balanced. This avoids the problem that they
would terminate GLFW completely when the main application is still using it.
This should fix the underlying problem of #2036 . It may still be useful to additionally merge #2065 .