feat: SG-35309: Set and save OCIO environment variable if missing and config is chosen#1263
Conversation
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
394d400 to
77ffaa4
Compare
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
|
Setting environmental variables at runtime while other thread are running and is not safe. If any thread just so happens to be reading one at the same time as another thread is setting a realloc can happen and getenv will read after free and potential crash. Linux at least performs not shared locking between getenv and setenv as far as I'm aware. I recently fix a bug with some of our RV plugins related exactly to this. |
According to our robot friend, @markreidvfx is right: The claim is technically correct, well-documented, and has bitten real applications repeatedly:
I think we should explore an alternative way of setting an OCIO config without having to set the OCIO environment variable. |
feat: Set and save OCIO environment variable if missing and config is chosen
Summarize your change.
When a user loads a valid OCIO config after opening a file and sets the OCIO as an active display with the environment variable
OCIOnot set, there used to be an error log. The error log is now gone and the environment variable is set after selecting a config.Moreover, the config path is saved to user preferences after choosing it.
Describe the reason for the change.
Redundant error logs and console pop ups because once the user loads the OCIO config with no environment variable there's already an error log.
Describe what you have tested and on which operating system.
Tested on Mac CY2025
Add a list of changes, and note any that might need special attention during the review.
N/A
If possible, provide screenshots.