-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Set darktable.control after initializing dt_control_t #20044
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?
Set darktable.control after initializing dt_control_t #20044
Conversation
0369d74 to
f74035d
Compare
|
|
First of all, obviously this doesn't hurt. But I'd argue if something is trying to use control at this early stage that is a bug. We should not just prevent it from accessing it, we should fix the order things are initialised. Because all of this is being set up in the main thread so there shouldn't be any concurrency yet. So if in Agree/disagree? EDIT: is there an active bug that this fixes? It may still benefit from a better fix? |
I (generally) think, if an allocated struct is made public, that should be done after initializing that struct. But:
|
f74035d to
e32d04e
Compare
|
@dterrahe "drafted" but added more code trying to locate a problem in |
|
What we often do when we want a function to print more debug info (and what imho is better) is to make it a macro that calls an "internal" function variant |
|
|
|
They're builtins. What I meant is, |
1. Set darktable.control after initializing the dt_control_t struct as we don't want the global control struct to be exposed before mutexes has been set. 2. Removed superfluous code as struct elements are already set by calloc. 3. last_expose_time in control is not used at all so it was removed 4. Simplified dt_control_cleanup() 5. Leave a note in log about starting/ending gtk_main() 6. If dt_control_running() is used without the global darktable.control being set, that we be a bug, so we report it.
e32d04e to
7d7ef94
Compare
|
Yeah, stupid me not doing that :-) force-pushed updated code with macro-reporting and some cleanup. |
We don't want the global control struct to be exposed before all internal stuff like mutexes has been set up.